This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: 15-100 HOMEWORK 1 - FALL 20071. Each of the following Java statements has an error. Identify whether the error is a syntax error or a logical error. Explain why. (You may assume the variables massand accelerationhave already been defined and initialized as doublevariables and neither contains the value 0.0.) (a) int x = (4 + 5) * 6) - (7 / 8);(b) double force = mass + acceleration; (HINT: Sir Isaac Newton)2. Consider the following board layout for Bots N Scouts demonstrated in class. The red robot is in the middle, facing left. Given the 9 instruction cards shown above, give a sequence of exactly five of these nine cards that will move the robot to the flag without getting injured (by stopping in the path of the laser) or killed (by falling into a pit or walking off the board). If you don't have a copy of the rules for Bots N Scouts, download a copy in the help section of our course website....
View Full Document
- Fall '07
- Isaac Newton, U.S. phone number, valid U.S. phone, bankTotal bankTotal bankTotal