CS 163/164, 🀨 Fall 2019 🀨
Programming Assignment - P3
Strange Formulas
Due Monday, Sep. 16th at 6:00pm
Late - Tuesday, Sep. 17th at 8:00am
Objectives of this Assignment
- To modify an existing program that you already wrote (code maintenance)
- to learn how to compartmentalize code into methods
Instructions
Copy your solution from P2: Strange Formulas and name the copy P3.java. Implement
this interface.
Then, modify your main to call the interface methods to perform the desired calculations.
You should move the code that performs the calculations for HBUs and SRM into the new methods, and then call those methods in main.
Don't change the interface at all! You only need to code in P3.java.
Sample Output
Your program should print 7 lines, just like P2, as below. The user input is shown in blue.
Alpha Acid? 5.0
Ounces? 2.0
The HBUs are 10.00.
Weight? 1.0
Lovibond? 80.0
Volume? 5.0
The SRM value is 9.5000.
Specifications
- Work on your own, as always.
- The name of the source code file must be exactly
P3.java
- Name the file exactly - upper and lower case matters!
- Assignments should be implemented using Eclipse.
- Assignments should be implemented using Java, version 1.8.
- Make sure your code runs on machines in the CSB 120 lab.
- Turn in through the Checkin tab.
- Read the syllabus for the late policy.
- We will be checking programs for plagiarism, so please don't copy from anyone else.
Grading Criteria
- 100 points for perfect submission.
- 0 points for no submission, will not compile, submitted class file, etc.
- Preliminary Tests
Preliminary tests use the values above for all inputs, same as P2, but also call your functions directly to get values.
- testCompile: checks that program compiles. (0 points)
- test1: Checks that all input lines work as in P2 (20 points)
- test2: checks third line of output with the HBUs. (10 points)
- test3: checks seventh line of output with the SRM value. (10 points)
- test4: Calls the hbu() method directly with above values (10 points)
- test5: Calls the srm() method directly with above values (10 points)
- Final Tests
Final tests use arbitrary values for all inputs, like P2, but also call your functions directly to get values.
- test6: Calls the hbu() method directly with a variety of values (20 points)
- test7: Calls the srm() method directly with a variety of values (20 points)
Submit P3.java to Checkin.