Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

--ert Draw OSM2030 LabSAssignment LK Lab 5 Assignment nested if and JOptionPane You are hired to write a Java program to determine whether a customer's

image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
--ert Draw OSM2030 LabSAssignment LK Lab 5 Assignment nested if and JOptionPane You are hired to write a Java program to determine whether a customer's order qualified for a discount and to show the final amount due after discount if any. The client wants to see dialogue boxes for their employee to type in data. The business rules are: i. The pre-discount amount is the product of the sales price and quantity ii. If the pre-discount amount (which is called "total SalesAmountFML on the flow chart) is greater than or equal to $500, apply a 5% discount. ii If the pre-discount amount (which is called "total SalesAmountFML on the flow chart) is greater than $100, apply a 10% discount. As any great designer, you should first "plan" (the "logie /algorithm/recipe) and then execute (writing the codes). Therefore, there are two parts of this assignment First part open a new Word file, save the file as FMLLabSAssignmentAlgorithm. [FML are your initials] a. Consider the followings 1. What variable/constant (if any) should you declare? Consider: name, data type, variable or constant 2. What statements do you need for dialogue boxes [JOption Pane)? jhint: import a specific method; convert Design Layout Lab5Assignment LK Display a dialogue box to ask for sales price por unit and assign to the inputStriagEMIL Then LeeAnn Kang covert to salesPriceFML variable. [need two statements Display a dialogue box to ask for quantity and assign the value to the inputStringFMI covert to quantityFMLvariable. [need two stalements a very important Then LeeAnn Kung Calculate [write the lrmula to calculate the totalSalesA moentFML refer to be haine" rule) If statement (Write a nested if statement to determine the sales discount based on the total sales amount (ales price quantity) the flow chart e d e. Close the dialogue box The Flow Chart U, Oiglay the sales amet with Second part: Follow your recipe to create a Java program Your Java program must have the following features: description section to describe the purpose, your name, .inline comments to describe those Java statements [steps from recipe the results similar to the screen shot below Deliverables Run the main method three times, catch cach screen/dialogue box i. First run: sales price 45.5, quantity- 15(screen shots below i. Second run: sales pricc -45.5, quantity 23 ii.Third run: sales price -45.3, quantity 10 First run: MacBook A lab Home Insert Dra Design Layeut References Malings Review Vew CISM2030 Lab5Assignment LK Input ? What is your name? Leesn Kung OK Cancel Input 2 what is the sales price of the item? OK Cancel ? What is the quantity you want to buy? 15 OK Cancel First run final message: Message MacBook Ai Home sert Dow Design Layout References Milig. Review First run final message: Message Leekan Kaars s is quan for 5% ouet and the discounted Ital sales amount-s S64LM wn the price of $455 and quantity of 15. Second run final message Message LeeAnn Kang's sales is quary tor 10% scoust andthe discounted total sales amounts)94135 with the price of $455 qaanty of 23. Third run final message: Message lIk's total sales amount is $455.00 with the price of $45.5 and quantity of 10 MacBook A P11 Heme sert Draw DesignLayout ferences Malings Review View CISM 2030 LK 2. Capture the result screens (dialog boxes) and paste to your FMLLabSAssignmentAlgorithm Word file. 3. Verify the results (i.e., use a calculator or Excel, plug in the numbers to the formulas you wrote to see 4. Submit two things: your FMI.LabSAssignmentAlgorithm Word file and zipped DiscountFML projeet Label your screen shots with meaningful titles. whether the results are correct) folder via Folio before the deadline 20

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

Recommended Textbook for

MySQL/PHP Database Applications

Authors: Brad Bulger, Jay Greenspan, David Wall

2nd Edition

ISBN: 0764549634, 9780764549632

More Books

Students also viewed these Databases questions

Question

4. Describe the role of narratives in constructing history.

Answered: 1 week ago

Question

1. Identify six different types of history.

Answered: 1 week ago