Solved by Expert Tutors
CSE 240 Homework 11, Fall 2016 (50 points) Due Saturday, November 5, 2016 at 11: strong concept Dr. Racket. Understood names and procedures Reading:...
Solved by Expert Tutors
Question

needs help with Scheme program language.  those are the HW instruction blow the file.  

CSE 240 Homework 11, Fall 2016 (50 points) Due Saturday, November 5, 2016 at 11:59PM, plus a 24-Hour grace period IntroducTon The aim of this assignment is to make sure that you understand and are familiar with the concepts covered in the lectures. By the end of the assignment, you should have strong concept func±onal paradigm. strong concept Dr. Racket. Understood names and procedures Reading : Text Chapter 4 and course notes (slides). This is a complete new language, and you need to spent more ±me to read and to program. PreparaTon : Complete the mul±ple choice ques±ons in the textbook exercise sec±on. The answer keys can be found in the course Web site. These exercises can help you prepare for your weekly quiz and the exam. You are encouraged to read the other exercise ques±ons and make sure you understand these ques±ons in the textbook exercise sec±on, which can help you be²er understand what materials are expected to understand aFer the lectures and homework on each chapter. You are expected to do the majority of the assignment outside the class mee±ngs. Should you need assistance, or have ques±ons about the assignment, please contact the instructor or the TA during their o³ce hours. You are encouraged to ask and answer ques±ons on the course discussion board. However, do not share your answers and code in the course discussion board. Practice Exercises (no submission required) 1 Tutorial: Getting Started with DrRacket 1.1 To complete this assignment, you will need to download and install a copy of Dr Racket (http://racket-lang.org/download/) on your local PC. 1.2 Start the program DrRacket. 1.3 Choose the “ R5RS ” from the language menu: CSE240 – Introduc±on to Programming Language 1 | P a g e Homework 11
Background image of page 1
DrRacket menu: language choose language Other Languages – R5RS. 1.4 Enter your programs/forms in the upper window of DrRacket and click on the “run” button to execute your programs/forms, e.g., enter: (write "hello world") (display "hello world") (newline) (newline) (write (+ (* 3 8) 10)) (display (+ (* 3 8) 10)) (- 20 5) (- 20 5) (write (read)) (display (read)) ; input a number from keyboard Click on run , the following results should appear in the lower window: hello world 34 15 2 Use DrRacket to calculate the following expressions/forms. (1) (2 + (4 + (6 + (8 + (10 + 12))))). (2) (((((2 + 4) + 6) + 8) + 10) + 12) (3) ((2 + 4) + (6 + 8) + (10 + 12)) (4) (2 + 4 + 6 + 8 + 10 + 12) (5) (2 + 4 * 6 + 8 * 10 + 12) (6) 125 187 (7) Input two integers: (+ (read) (read)) 3 Write Scheme programs/forms to (1) find the second element of the list ‘(2 4 6 8 10 12). Your form should work for any list containing two or more elements. (2) find the last element of the list ‘(2 4 6 8 10 12). Your form only needs to work for lists of six elements. (3) merge the two lists ‘(1 2 3 4) and ‘(5 7 9) into a single list '(1 2 3 4 5 7 9) (4) obtain the length of the list ‘(a b x y 10 12) (5) check whether '(+ 2 4) is a symbol (6) check whether '+ is a member of the list '(+ 3 4 6) (7) check whether "+", '(+ 3 5), "(* 4 6)" are strings (8) check whether (* 3 5), '(/ 3 7), (1 2 3 4), "(+ 2 8) and "( 1 2 3)" are strings Programming Exercise (50 points) In this assignment, you will be learning Scheme through the use of Dr. Racket. We would like to start with some basic concepts; trying to under preFx notaTon and the use procedure in Scheme. You will also implement a few simple procedures. You may only use the procedures shown in the text and slides - not any of the addiTonal library procedures in Scheme. 1. Using Dr. Racket, compute the following expressions. [5 points] 1.1 8 + 2 - 10 1.2 2 * ( 5 + 10 + 5 ) - 30 CSE240 – IntroducTon to Programming Language 2 | P a g e Homework 11
Background image of page 2
Show entire document

Step-by-step answer

or nec facilisis. Pelle

ipsum dolor sit amet, consectetur adipiscing elit. Nam

ac, dict

lesti

ur laoreet. Nam risus ante, dapibus a molestie consequat, ultrices ac magna. Fusce dui lectus,

cing elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque dapibus efficitur laoreet. Nam risus

o. Donec aliquet.

Subscribe to view the full answer

Why Join Course Hero?

Course Hero has all the homework and study help you need to succeed! We’ve got course-specific notes, study guides, and practice tests along with expert tutors.

  • -

    Study Documents

    Find the best study resources around, tagged to your specific courses. Share your own to gain free Course Hero access.

    Browse Documents
  • -

    Question & Answers

    Get one-on-one homework help from our expert tutors—available online 24/7. Ask your own questions or browse existing Q&A threads. Satisfaction guaranteed!

    Ask a Question
Let our 24/7 Computer Science tutors help you get unstuck! Ask your first question.
A+ icon
Ask Expert Tutors You can ask You can ask You can ask (will expire )
Answers in as fast as 15 minutes