CSC 151.01, Class 10: Side Effects: Output and Input
Overview
- Preliminaries
- Notes and news
- Upcoming work
- Extra credit
- Questions
- Preparation
- Lab
- Debrief
News / Etc.
- Continue partners and positions!
- Exam 1 will be distributed on Wednesday.
- I really do think that you are best served by working in the CS labs; you have people to help you and talk to. However, if you want to work on your own, it doesn’t work to download DrRacket (unless you run Linux). You either need to download a virtual machine (more on that soon) or connect remotely to MathLAN. You can find information under Reference -> Remote.
- Remember: If you want to look at the eboard “in progress”, replace the
.htmlat the end with.md. - Welcome to Sarah Dahlby Albright, our Peer education coordinator.
Reminders
- I’m always happy to (try to) answer questions via email. There is no need to apologize when sending me questions. If I take too long to answer, send another email (or even text, if it’s a reasonable hour).
- I’m always happy to see students during my office hours. I prefer that you book me at https://rebelsky.youcanbook.me, but you can also just show up during office hours and hope that I’m not busy.
- We have tutors available Sunday through Thursday evening from 7-10 p.m. in Science 3813/15.
- We have mentor sessions on Wednesday and Thursday evenings from 8:00-9:00 p.m. in the CS Commons. Wednesdays will be more Q&A, Thursdays will include sample quizzes.
- I run review sessions on Thursdays at 9am in this room.
- We have individual tutors available for those who take advantage of the above and find that it’s not enough.
- We have office supplies in the commons. Price is free will donation.
- Feel free to ask me to sign you up for the department mailing list.
Upcoming Work
- Assignment 3. Due TONIGHT!
- Reading: Documentation.
- Lab writeup: Exercise 4. Due Friday before class.
Extra credit (Academic/Artistic)
- CS Table, TODAY at noon, 7 Feb 2017. Something on privacy. See email.
- Scholars Convocation, Thursday, 9 Feb 2017, 11:00 a.m., JRC 101.
- Thursday extras, Thursday, 9 Feb 2017, 4:15 p.m., Science 3821: Something on computer graphics (visitor from UMN). Let me know if you want the email.
Extra credit (Peer)
- Saturday the 18th, Symphony Concert. 2-4 p.m. Sound painting and more! In Sebring-Lewis.
- Friday-Saturday-Sunday, 17th-19th, Swimming and diving conference championships.
- Track meet this Saturday.
- Milo the Rapper and Krunkhy Kidz 9 p.m., Gardner.
Be moderate in all that you do. - South-Asian Chai time on Friday, at 4pm, in JRC 2nd floor.
- Org fair on Thursday. Noon-1
Extra credit (Misc)
- Update on Admission and Financial Aid Building and Campus Landscape Projects. Wednesday, JRC 101, 11:45-1:00. Pizza!
Good things to do
- Read the Electronic Frontier Foundation’s Surveillance Self Defense Tips at https://ssd.eff.org/.
Questions
There were not additional questions today.
Preparation
Go over the self checks with your partner, and make sure that you have answers to the following questions
From what you read and from your experiments, what do you see as the
differences between read and read-line?
-
Both can take no arguments. Both can take an argument.
-
read-linereads text,readreads numbers (or other kinds of values). -
readcan read text, as long as you put quotation marks around it. -
If you don’t put quotation marks around the text, it gets read as a symbol.
What does yield do and why do we have it?
;;; Procedure:
;;; yield
;;; Parameters:
;;; val, a value
;;; Purpose:
;;; Display a short message about val
;;; Produces:
;;; val, the same value
;;; Preconditions:
;;; [No additional]
;;; Postconditions:
;;; A short message is displayed
(define yield
(lambda (val)
(display " yields ")
(display val)
(newline)
val))
- It tells you what you get. We use it to print out the results of expressions, or intermediate expressions.
- Prints out a value in the form “yields ___”
- Returns that value, so that it can be used by the next operation.
- Once we know output, we find that values can go in multiple directions.
- The value returned by the procedure is sent to the enclosing expression.
- The printed stuff goes to the screen.
- If there is no enclosing expression, the returned value also goes to
the screen.
(In a subtly different color.)
Why do we have procedures like
add?
(define add
(lambda (x y)
(display "add ") (display x) (display " and ") (display y) (newline)
(yield (+ x y))))
Lab
- Don’t forget to download the file that starts the lab.
- Computers are sentient and malicious, and magically change the number 64 to 63 sometimes.
Writeup
Write up exercise 4 from the lab on input and output.
Send your solution to csc151-01-grader@grinnell.edu.
Title your email CSC 151.01 Writeup for Class 10 (YOUR FULL NAMES).