CSE1020 Practice Labtest

Please read this part carefully

The purpose of this practice labtest is to introduce you to the labtest environment. Also, you should be able to self-assess your ability to:

In the labtest environment, you have no access to your files in your normal CSE account, USB drives, CDROM, and the Internet (including other machines in the lab).

Also, the machines reboot at the end of the test, and any files you created during the labtest are not saved. Any files that you want to submit for grading must be submitted before the end of the labtest. You will receive a warning every minute starting five minutes before the end of the labtest.

Previously submitted assignments and lab work

For some tests (like this one), you will be able to retrieve your previously submitted assignments and lab work. This practice test allows you to retrieve the lab work you just submitted. You can find your submitted Lab 2 files in your home directory in the sub-directory unsubmit/L02

 

The Practice Test

Write a program called SillyMath that reads three integers from the command line where:

 

Your program should take your street address (the first integer) and:

  1. Double it
  2. Add 42 to the result of Step 1
  3. Multiply 50 by the result of Step 2
  4. Subtract the year of your birth from the result of Step 3
  5. Subtract 50 from the result of Step 4
  6. Add the number of birthdays you have had so far this year to the result of Step 5
  7. Subtract 40 from the result of Step 6
  8. Output the result of Step 7 on a line by itself
 

Use one line of code for each of the steps (yes, it is possible to write a correct solution using one line of code for all of Steps 1-8, but please just use the "obvious" translation to Java code for each step).

It is easy to check if your solution is correct; the last two digits of the output should be your age, and the remaining digits should be your street address. For example, suppose that:

 

then running your program would produce:

java SillyMath 5678 1991 1
567820

If you did not reach Part 3 of Lab 02, then you can start with the following program:

 

Submit

Submit your program using the command:

submit 1020 practice SillyMath.java

You may leave when you are finished.