Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribedimage text in transcribedimage text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

CL I P COL Astro- L(1-cas0) Lsing *A=2 L sin(0/2)

Answered: 1 week ago