Write a java program called Sales considering the following directions and the sample run. Practice here first the write answer on the answer sheet. Also, make sure to distinguish high and low caps as Java is case - sensitive. - import and declare a Scanner class - declare three floating – point variables named price, discount, and discountPrice - ask the user for the price (print statement) and get the price (Scanner) from the user - calculate the discount if price is less than 100, then the discount is 10% of price, else discount is 14% of price - print the discounted prices for the item   Sample Run Enter the price 90.0 The discount price is 81.0   Enter the price 200.0 The discount price is 172.0

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter5: Control Structures Ii (repetition)
Section: Chapter Questions
Problem 21PE
icon
Related questions
Question

Write a java program called Sales considering the following directions and the sample run. Practice here first the write answer on the answer sheet. Also, make sure to distinguish high and low caps as Java is case - sensitive.

- import and declare a Scanner class

- declare three floating – point variables named price, discount, and discountPrice

- ask the user for the price (print statement) and get the price (Scanner) from the user

- calculate the discount if price is less than 100, then the discount is 10% of price, else discount is 14% of price

- print the discounted prices for the item

 

Sample Run

Enter the price

90.0

The discount price is 81.0

 

Enter the price

200.0

The discount price is 172.0

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Random Class and its operations
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
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning