This class will be recorded! Its use is limited to members of the class. Please do not share with others.
Approximate overview
I will post details to the Announcements channel.
Here’s a sample solution.
-> (add-3 (* 2 3) (+ 8 3) (/ 1 2))
-> (add-3 (* 2 3) (+ 8 3) ( 0.5 ))
-> (add-3 (* 2 3) ( 11 ) ( 0.5 ))
-> (add-3 ( 6 ) ( 11 ) ( 0.5 ))
-> (+ (+ 6 11 ) ( 0.5 ))
-> (+ ( 17 ) ( 0.5 ))
=> 17.5
Some notes
Clarification: Are quizzes satisfactory / non-satisfactory?
Yes (1 for satisfactory and 0 for non-satisfactory/redo)
Do you have a recommendation on how to approach coding quizzes?
Type the code in Gradescope.
Click “Submit”.
Click “Resubmit”. (That way, it’s ready for your next submission.)
Copy and paste the code into DrRacket.
Work on it for a bit.
Copy and paste the improved code into Gradescope
Click “Submit”.
Continue as appropriate.
Why submit before working in DrRacket?
At least one person got caught up in working in DrRacket and never submitting anything.
But if you’re really fast, you can start in DrRacket.
I screwed up the quiz. What happens next?
I will release a makeup quiz. You can take it on your own time.
Note that you only need a satisfactory on 21 of 25 quizzes to meet that component of an A grade.
What do quizzes cover?
Generally, the prior day (and before).
Often a problem related to the prior day’s lab.
What are the answers to the quiz?
(define ball (circle 20 'solid 'black))
(above ball
(beside ball ball)
(beside ball ball ball))
Can we have the answers to today’s quiz?
Yes.
Do makeup quizzes cost tokens?
No.
When are makeup quizzes released?
Usually the day or day after the quizzes are returned?
When do you return quizzes?
Usually the day after you take the quiz, sometimes a day later.
What should we do if we run out of time on a lab?
Option one: Continue to work for the next twenty minutes or so. I’ll generally stick around. Submit after those twenty minutes.
Option two: Set another time to meet and finish up.
Option three: Split up, finish it individually, make sure to cite/acknowledge each other. “I did problems 1–3 with Yksleber.”
Note: Please negotiate with your partner.
What should we do if we finish a lab early?
Option one: Do the extra problems (if we’ve written any).
Option two: Work on the next mini-project. It’s nice to have time when you can ask questions.
Option three: Leave.
Note: Please negotiate with your partner.
When would you want to write a zero-parameter procedure?
There are some procedures that we call for “side effects”; they do something other than return a value. The most frequent side effect is to write something out.
Here’s an example. You need not understand.
(define seven
(lambda ()
(display "The user wants the value seven")
(newline)
7))
(define six
(lambda ()
(display "The user wants the value six")
(newline)
6))
> (* (seven) (six))
The user wants the value seven
The user wants the value six
42
Do you realize you screwed up the due date on today’s lab writeup?
Thanks. I’ll fix it.
Why don’t we need black in quotation marks in the following?
(define ball (circle 20 'solid 'black))
The designers of the circle procedure allow you to use strings (in double quotation marks) or symbols (preceded by tick marks).
What does a non-coding quiz look like?
Likely questions on algorithms or how we approach problems in Scheme/Racket.
More conceptual, less “write code to do this”.
What is the relation between a parameter and a defined variable of the same name?
They are independent. They may confuse the human, but the computer treats them differently.
Bring up readings in your browser.
(Don’t bother opening DrRacket.)
Go to the Quiz in Gradescope.
Eight minutes (more or less).
New pairs! Let’s hope Sam can get the code to run.
You will not be able to finish in class. Sorry. You may finish on your own or arrange a time to meet with you partner later.
Sam (well, Sam using a computer program he wrote) assigns groups.
First person in the group goes to the Lab Sessions channel, clicks the camera (or something equivalent) and then “Meet Now”. Please get the channel right. We won’t see you in other channels.
Add a subject. “Group # (Names)”, such as “Group 1 (SamR & JohnG)” Please get the group name right. It makes it much easier for us.
Click “Meet Now”.
Invite the other members of the group.
Other members of the group join. (Today, you can start discussions once you have two in the group. Generally, you’ll wait until everyone is there.)
Discuss/work/whatever.
There are four problems. You should submit at least the first three by the end of class. Sam will warn you when there are ten minutes left in class so that you can decide whether to submit the first three problems or try to do all four together.
We probably won’t have time, but I like to leave the potential there.
I’m not sure whether or not we’ll get to this today, but it’s a reminder for me to discuss it with you some time soon.
Most work that is correct will be M (meets expectations) rather than E (exemplar / exceeds expectations). E work is code we could share with your fellow students as, well, an exemplar. (A good exemplar.)
Meets expectations
(above (circle 20 'solid "black")
(beside (circle 20 'solid "black")
(circle 20 'solid "black"))
(beside (circle 20 'solid "black")
(circle 20 'solid "black")
(circle 20 'solid "black")))
Also meets expectations, even though it doesn’t work.
(above circle 20 'solid "black")
beside (circle 20 'solid "black")
(circle 20 'solid "black"))
(beside (circle 20 'solid "black")
(circle 20 'solid "black")
(circle 20 'solid "black"))))))))
Better (probably the best you can do right now)
(define ball (circle 20 'solid "black"))
(above ball
(beside ball ball)
(beside ball ball ball))
Overkill (beyond what you can do right now)
(define ball (circle 20 'solid "black"))
(define row-of-balls
(lambda (n)
(if (= n 1)
ball
(apply beside (make-list n ball)))))
(define pyramid
(lambda (rows)
(apply above (map row-of-balls (cdr (iota (+ 1 rows)))))))
(pyramid 3)