; CS101, Spring 2013 ; Lab 1 Racket starter file ; This file is intended to be opened within the DrRacket ; programming environment. It contains meta-data that is ; unreadable in browsers and text editors. ; Once this file is open in DrRacket: ; ; UNDER THE Language MENU, SELECT: ; Choose Language...under Teaching Languages click on the ; arrow to the left of How to Design Programs and choose ; Advanced Student ; OR ; Go to the lower left corner and drag down to Advanced ; Student ; ; AFTER CHOOSING A LANGUAGE, CLICK THE RUN ICON ON THE UPPER ; RIGHT TO SHOW THE RESULT OF RUNNING THIS CODE. SOME TEXT ; WILL APPEAR IN PURPLE IN THE INTERACTIONS WINDOW (READ ON). #| EVALUATING EXPRESSIONS: In this lab, you will - run, make modifications to, and save this file in DrRacket and - submit your lab1 directory containing this file after your modifications have been made. Read carefully, follow directions and ask questions if you have them. There will always be someone available to answer questions during lab sessions, although you may have to wait your turn. |# ; INFORMATION ABOUT COMMENTS: ; ; Lines that begin with a semicolon (like this one) are ; single-line comments. Semicolons can also be used to ; end valid lines of code with comments (this is called ; in-line documentation). #| Multiple-line comments begin with #| and end with |# REGULAR COMMENTS ARE SHOWN IN BROWN TEXT. |# ; ; Comment boxes (like this one) are another way to make multiple ; line comments (text in a box is not brown but it is still a ; comment). ; ; Comments are meant for us to read and are ignored by the ; computer. ; ; Commands for commenting and un-commenting code can be found ; under the Racket menu. Comment boxes can be inserted by ; choosing the proper menu choice under the Insert menu. ; ; ; PART I. CHECK OUT THE DISPLAY FUNCTION: ; ; The display function is used to print strings in the inter- ; actions window when a program is run. Strings are characters ; enclosed in quotation marks (shown in green in the defini- ; tions window). ; Press the Run button at the top right of the screen ; and check out what prints in the interactions window. ; You'll soon learn to recognize function calls because they ; are not written in comments and they always start with an ; open parenthesis. ; The following 2 lines are valid function calls (they are the ; only uncommented lines in this file): (display "\nCS101 Lab 1, Spring 2013\n") (newline) ; ; If you press Run, the line "CS101 Lab 1, Spring 2013" will ; be evaluated, causing purple text to be printed in the ; interactions window (which will open on the bottom half ; of the window at this point if it is not already open), ; followed by a blank line. ; The \n's inside the string argument to the display ; function are newline characters. They cause a blank line ; to display in the interactions window and are otherwise ; invisible in the printout. ; The only argument to the display function written above ; is the string "\nCS101 Lab 1, Spring 2013\n" (inside ; quotation marks, strings are colored green by default ; (except when they are inside a comment)). ; PART II. ADD FOUR MORE CALLS TO THE DISPLAY FUNCTION: ; Add enough display statements (like the one shown above) ; where it says ;. The goal is ; to produce the text shown in the comment box below in the ; interactions window when you press Run (the first line is ; already done for you). ; ; CS101 Lab 1, Spring 2013 ; ; Name: Type Your Name Here ; Year: Type Your Vassar College Class Year Here ; Experience: E.g., Java, C++, none (whatever fits you) ; Lab section: Jan. ?? at ? am/pm ; ; Fill in your own name, your own class year, your previous ; computer programming experience ("none" is a fine response, ; or you may have a long list of past experience), and lastly ; the date and time of this lab. ; Save this file, show it to a coach or your professor, and ; then go back to reading the file lab1inst.txt for directions ; on submitting this lab.