I'm having trouble with the inch-count. i defined inch-count like this: (inch-count feet inches), so i would test it with (inch-count 2 3). However, the example asks us to do (inch-count '(2 3)), so before, i tried defining inch-count like this (inch-count '(feet inches)), but this keeps returning an error.
here is what i did specifically:(define (inch-count '(feet inches)) (+ (* 12 feet) inches)))I was able to define this procedure, but when i input values like (inch-count '(2 3)), it produced an error.
also, in the question that asks to convert inches to height. I can get a decimal value, but im not exactly sure how to utilize the quotient and remainder procedures and have something like 2 feet and 3 inches appear in my answer, since scheme only produces one value and therefore cannot return two separate values. so should we leave the answer in decimal form?
Materials that we have given you in lab you should TRY to get done that day, of course. We will look at some of these materials, but no means all, as the "random step" check mentioned in the general information. We won't check on this for at least the next lab (i.e., when the homework would be due), but it might be longer. So, if you can't get to it that day, try to get to it before the next lab.
The inch-count exercise is getting at writing a procedure that take a single sentence argument versus multiple word arguments. These are very different formats (to Scheme), even though the procedures themselves are going to be able to work with the same information.
So, for the situation where you want to pass the procedure inch-count a sentence [i.e., (inch-count '(2 3)) ], you'll need to define it so that it takes only one argument. Then, inside the procedure, you can look at the first of that sentence (to get the feet), and the last of that sentence (to get the inches).
In your latter question, scheme can also return a sentence (which is a "single value"). This sentence can be any length! So, inside the procedure you can construct a sentence with "se" (or "sentence").
when i'm typing in the emacs buffer, is there any shortcut to move down to the stk prompt thingy? (aside from using the mouse)
By "stk prompt thingy", we assume you mean the STk frame at the bottom of the emacs window (after you've opened it).
One way to switch between the frames is to type ctrl-x followed by o. Check the multiple windows section of the emacs reference in your reader (or, from the resources menu from the course portal).
Also note that, if you look at the scheme menu, there are two types of "send" choices: those with and without the "& go" phrase. If you select the "and go" version, the cursor will be sent to the STk frame after the appropriate "send" happens.