2. Compute the cost based on the following: If the quantity is less than 10 the cost is quantity times price. If the quantity ordered is 10 or more, there is a 10% discount. Print a message that there is a 10% discount and print the discounted price. Calculate the discounted cost. Print the cost, with exactly 2 decimal places. So if 10 were ordered at 12.50 you would print: Discount of 10% applies: Discount of 1.25 per item. Discounted price is 11.25 Cost is 112.50 If 5 were ordered you would print: Cost is 62.50 (5 x 12.50)

Programming Logic & Design Comprehensive
9th Edition
ISBN:9781337669405
Author:FARRELL
Publisher:FARRELL
Chapter4: Making Decisions
Section: Chapter Questions
Problem 16RQ
icon
Related questions
Question

Java

2. Compute the cost based on the following:
if the quantity is less than 10 the cost is quantity times price.
If the quantity ordered is 10 or more, there is a 10% discount. Print a message
that there is a 10% discount and print the discounted price. Calculate the discounted
cost.
Print the cost, with exactly 2 decimal places. So if 10 were ordered at 12.50 you would
print:
Discount of 10% applies: Discount of 1.25 per item. Discounted price is 11.25
Cost is 112.50
If 5 were ordered you would print:
Cost is 62.50 (5 x 12.50)
Transcribed Image Text:2. Compute the cost based on the following: if the quantity is less than 10 the cost is quantity times price. If the quantity ordered is 10 or more, there is a 10% discount. Print a message that there is a 10% discount and print the discounted price. Calculate the discounted cost. Print the cost, with exactly 2 decimal places. So if 10 were ordered at 12.50 you would print: Discount of 10% applies: Discount of 1.25 per item. Discounted price is 11.25 Cost is 112.50 If 5 were ordered you would print: Cost is 62.50 (5 x 12.50)
Expert Solution
steps

Step by step

Solved in 3 steps with 3 images

Blurred answer
Knowledge Booster
Introduction to computer system
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
Np Ms Office 365/Excel 2016 I Ntermed
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:
9781337508841
Author:
Carey
Publisher:
Cengage
Operations Research : Applications and Algorithms
Operations Research : Applications and Algorithms
Computer Science
ISBN:
9780534380588
Author:
Wayne L. Winston
Publisher:
Brooks Cole