Java Program Assignment 1
Before attempting this project, be sure you have completed all of the reading assignments,
nongraded exercises, discussions, and assignments to date.
Write a Java program which:
(1) Prompts a user to enter customer id, unit price in this format (e.g. 3.75), quantity (as whole number), product description, and discount in this format (e.g., .10) (use Scanner for input).
(2) Calculates the customer’s overall order total before and after discount.
(3) Displays the input data along with the order total before and after the discount to the console. Java Program Assignment Help
To calculate order total before discount: (unit price multiplied by quantity)
To calculate order total after discount: (unit price multiplied by quantity) multiplied by 1
minus (unit price multiplied by quantity) multiplied by discount
• Example 1: For this example, given unit price of 5.00 with a quantity of 2, and the
discount of .10: (5.00*2) = 10.00 order total before discount and (5.00*2) * 1 –
(5.00*2) * .10 = 9.00 order total after discount
• Example 2: For this example, given unit price of 7.00 with a quantity of 3, and the
discount of .15: (7.00*3) = 21.00 order total before discount and (7.00*3) * 1 –
(7.00*3) * .15 = 17.85 order total after discount
• Example 3: For this example, given unit price of 12.50 with a quantity of 2, and
the discount of .10: (12.50*2) = 25.00 order total before discount and (12.50*2) *
1 – (12.50*2) * .10 = 22.50 order total after discount
Summary of the Examples:
Example # Unit Price Quantity Discount Total Price
1 5.0 2 .10 10.00 9.00
2 7.0 3 .15 21.00 17.85
3 12.50 2 .10 25.00 22.50
Test program: Java Program Assignment Help
A minimum of 3 test cases should be supplied in the form of table with columns indicating the input values, expected output, actual output and if the test case passed or failed. This table should contain 4 columns with appropriate labels and a row for each test case. An example template is shown below. Note that the actual output should be the actual results you receive when running your program and applying the input for the test record.
Make sure your Java program is using the recommended style such as:• Javadoc comment up front with your name as author, date, and brief purpose of the
• Comments for variables and blocks of code to describe major functionality
• Meaningful variable names and prompts
• Class names are written in upper CamelCase
• Constants are written in All Capitals
• Use proper spacing and empty lines to make code human readable
For Java Program Assignment Help please click here