Java Math Problem from Partner
Write a program in Java to solve a numerical problem. Each team member will
write a math problem story for the other team member. The other team member
will write the program. The master programmer will put the two programs together
so the first story runs and then the second one runs and then it prints the
sum of the result of both stories. The test data for both stories needs to be
in the comments. Remember to use the HELP board if you have trouble. Instructions
for downloading BLUEJ are in the syllabus.
Here are the steps:
1) Decide upon a problem that can be solved by taking in a couple parameters,
doing a calculation and printing a result, and then returning that result. Some
ideas and other ideas are fine:
- Create a kilometers to miles converter program that takes in a number in
kilometers and then computes and displays the corresponding number in miles.
- Write a liters to gallons converter program that takes in liters and computes
the corresponding number of gallons.
- Write a mileage program that takes in the distance they have driven, how
much fueld thay have used and then computes the mileage.
- Write a payroll program that takes in the number of hours worked and the
hourly wage and then computes the user's pay. (pay = hours * wage)
- Write a reverse payroll program that takes in the number of hourse you've
worked and your weekly net profit and then computes your wage in dollars per
hour.
- Create a carpet area program that takes in the length and width of a room
(in feet) and then computes and displays the area of the floor of that room
(in square yards).
- Make a BMI converter that takes in Weight in pounds, height in inches and
calculate BMI as (weight in pounds / height in inches * height in inches *
703)
2) Write a specificiation of what the user should see when they run this method.
3) Give your specification to your partner by replying to the discussion board
entry under your group.
4) Design and code your partner's spec. (Each person will code their teammate's
spec.)
- Please create your class name as the names of the team members. (ex: If
I worked with Mary Jones, my class name would be: KrisPepperAndMaryJones)
- Please create a main method and a method named with your name. (ex: I would
have 2 methods, main and pepper)
- Please code the spec using commands inside the method named with your name.
(ex: I would put all the print commands inside the pepper method.
4) Test your own method to see it prints what it should.
5) Type your test data into the comments.
6) Test your own program using all your test data
7) Give the finished program to the master programmer for this assignment (and
this position should rotate for the next assignment). Copy and paste all your
code into a reply on the discussion board.
8) The master programmer will merge the two by doing the following:
- Please find your partners posted code on the discussion board.
- Copy the method that has all the commands right after your print method
ends.
- ex: If Mary Jones had posted: public static void mary(){System.............;}
I would put all that before my last }
- Change your main method to call your partner's method after your own
- Add the results of the call to your method and the call to your partner's
method.
- Print the total.
- Post the result to the bulletin board and ask your partner to check it.
9) The NON-master programmer will verify that the main method correctly calls
the methods and adds up the total returned.
Please upload just the .java file into this assignment.