Question: 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

 Assignment 1 Before attempting this project, be sure you have completedall of the reading assignments,nongraded exercises, discussions, and assignments to date. Writea Java program that: 1. Prompts a user to enter customer id,

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 that: 1. Prompts a user to enter customer id, the unit price in this format (e.g. 3.75), quantity (as a 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 the discount. 3. Displays the input data along with the order total before and after the discount to the console. To calculate the order total before the discount: (unit price multiplied by quantity) To calculate the order total after discount: (unit price multiplied by quantity) multiplied by 1 minus (unit price multiplied by quantity) multiplied by the discount. - Example 1: For this example, given unit price of 5.00 with a quantity of 2, and the discount of .10:(5.002)=10.00 order total before discount and (5.002)1(5.002).10=9.00 order total after discount - Example 2: For this example, given a unit price of 7.00 with a quantity of 3 , and the discount of .15:(7.003)=21.00 order total before discount and (7.003)1(7.003).15=17.85 order total after discount - Example 3: For this example, given a unit price of 12.50 with a quantity of 2 , and the discount of .10:(12.502)=25.00 order total before discount and (12.502)1(12.502).10=22.50 order total after discount Summary of the Examples: Test program: A minimum of 3 test cases should be supplied in the form of a table with columns indicating the input values, expected output, actual output, and if the test case passed or failed. This table should have 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 theprogram - 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 Capture execution: You should capture and label screen captures associated with compiling your code and runningeach of your 3 test cases. Here is a sample run: Enter customer id: 4225 Enter unit price in decimal format (e.g. 3.5): 5.0 Enter quantity: 2 Enter product description: Whole Wheat Bread Enter discount in decimal format (e.g. .05): .10 ORDER DATA: Customer id: 4225 Unit Price: 5.00 Quantity: 2 Product Description: Whole Wheat Bread Discount: .10 Order total BEFORE discount 10.00 Order total AFTER discount 9.00 Example test cases: Submission requirements Deliverables include a Java program (.java) and a single Word (or PDF) document. The Java andWord/PDF files should be named appropriately for the assignment (as indicated in the SubmissionRequirements document. The word (or PDF) document should include screen captures showing the successful compilingand running of each of the test cases. Each screen capture should be properly labeled to indicate what the screen capture represents. The test cases table should be included in your Word or PDF document and properly labeled as well. Submit your files to the Assignment 1 submission area no later than the due date listed in the online classroom calendar

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!