last updated: Fri Sep 20 17:24:08 EDT 2002
The goals of this assignment are to:
|You have two robots. Each robot has 4 wheels, two of which are connected to motors. These are called drive wheels. You know the diameter of each robot's drive wheels, and you know the rotation rate of the motors (i.e., how many times per second the wheels go around). You need to determine which robot will travel farther during a given time period.|
Your program has to do the following:
You can assume that the input values are all whole numbers. Your calculated outputs should be real numbers.
Below is a sample run for two cases. The unix command line is highlighted in bold font.
unix$ java hw2eis2003 3 5 3 3 5 ROBOT #1: diameter = 3cm rate = 3rps ROBOT #2: diameter = 5cm rate = 3rps time = 5sec robot #1 went 141.3716694115407cm robot #2 went 235.61944901923448cm robot #2 travelled farther unix$ java hw2eis2003 1 2 3 4 5 ROBOT #1: diameter = 1cm rate = 3rps ROBOT #2: diameter = 2cm rate = 4rps time = 5sec robot #1 went 47.12388980384689cm robot #2 went 125.66370614359172cm robot #2 travelled farther
Your source code (i.e., your
.java file) but be neat and
You must have a header comment and you should comment the end of each
block (i.e., each
Follow the submission instructions carefully!!! If you don't, human intervention will be required to fix your mistakes, and you will lose 1 point.
This assignment is worth 7 points (out of 100 for the semester). Distribution of points is:
Start building your program from a working version of homework #1, and modify that code. Always make small changes, compile and run them to make sure they work. This way you always have code that compiles and runs -- you may have a partial solution, but a partial solution that compiles and runs is better than a complete solution that doesn't compile or run. Because if it doesn't compile or run, it's not a complete solution.