2015-09-18 HW04

posted Sep 17, 2015, 9:42 PM by Samuel Konstantinovich   [ updated Sep 18, 2015, 7:20 AM ]
***The  HW04 slot will not be posted until the end of the school day. I will add all new students + put the slot there by the end of the school day. 

HW04:
On the homework server, submit a plain text document with the following:

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

In the plain text document Answer questions 1 + 2.

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