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
Write a java
- 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
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images