Comp101 Lab4

Due:  11:59 pm Tues March 4th. Wednesday March 5th.


In this lab you will continue your java programming experience writing a very simple program from scratch.



Make sure you do all of your work for this lab in its own folder.

mkdir Lab4

and then move into that folder to do all of your work.

You are going to write a very simple command line calculator. Since we don't have too many programming contructs yet, you will write a calculator that only does addition. Your program must
  1. prompt the user to enter a first number and then read in that first number from the user.
  2. prompt the user to enter a second number and then read in that second number from the user.
  3. Add the two numbers and then print the result to the screen.
thats it. Its pretty simple really, but this is the first one where I've not told you what every single method should looke like. There is one additional requirement, when you write your main method, it cannot be more than 2 lines long. Therefore you'll have to do your actual work in one or more methods in the class that you write. You furthermore cannot have any static methods in your class other than the main method. (So you will have to create an object to do the work)

Since you are writing your own methods, you'll need to comment your methods in this lab. Some portion of the grade for the lab will be reserved for comments.


When you submit this time, add a readme.txt file to your Lab3 folder that you are building. (In xemacs you create a new file by doing <file><open file> and typing in a brand new file name. The readme should contain:
Once you have the readme done, cd into your parent folder, zip up the entire Lab4 folder using the -r flag as you have learned in the earlier labs, and use the online submission program to submit it to me.