2016-09-14 HW03

posted Sep 14, 2016, 6:19 AM by Samuel Konstantinovich   [ updated Sep 14, 2016, 10:31 AM ]
Do Now:
1. Evaluate:
a) (quotient (remainder 12 11) (remainder 5 3) )
b) ( / (- (* 3 2) 5) (* (- 3 2) 5) )
2. Convert to prefix notation:
a)  8 + 3 * 2 + 1 
c)  9 - 1 / 2 + 3 * 2
b)   7 - 4
     (5 * 2)2

Goal : Using Dr.Racket on the School Computers.







This header is to be included on all submitted assignments
;Last name, First Name
;STUY ID
;MKS21 Period<x>
;YYYY-MM-DD
;HW<x>

e.g.
;Smith, David
;1234
;MKS21 Period4
;2015-09-18
;HW04

HOMEWORK!

HW03:


Answer the following questions, and bring in a typed copy with your header. 

1. Convert the infix expression to prefix.
 a. ( 5 - 4 * 2 ) / ( 10 - 5 ) + 3
 b.   2 +  3 ( 4 - 2) / ( 1 - 3 / 5 ) 
 c.   4 + 3 * 2 
      ----------   -    1
        5 - 10    

2. Evaluate the expressions (show the steps you took line by line) You may verify your result using DrRacket.
 a. ( * (+ 4 -7 9) (/ 15 5) (- 3 -1) )
 b. (/ (- 20 -4)   (* -3 (* 2 -1)))

Comments