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

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 Answer

Want to see the step-by-step answer?

See Answer

Check out a sample Q&A here.

Want to see this answer and more?

Experts are waiting 24/7 to provide step-by-step solutions in as fast as 30 minutes!*

See Answer
*Response times vary by subject and question complexity. Median response time is 34 minutes and may be longer for new subjects.
Tagged in
EngineeringComputer Science

Programing Language

Related Computer Science Q&A

Find answers to questions asked by student like you
Show more Q&A

Q: You are not required to execute the queries. However, your syntax must by accurate.You must give at ...

A: Hey, since there are multiple sub-part questions posted, we will answer first three questions. If yo...

Q: function myCompose(f,g){// TODO: return (f o g);// that is, a function that returns f(g(x)) wh...

A: Click to see the answer

Q: Assume that you have been tasked by your employer to develop an incident response plan. Create a lis...

A: Stakeholder:A stakeholder can be a person, a group, or an organization that has an affair or matter ...

Q: For this program you need to use Eclipse

A: Program plan:Declare the integer variables “coin” and “guess” and string variable “num”.Generate the...

Q: Design a modular program that asks the user to enter the monthly costs for the following expenses in...

A: We are designing the program in C++ programming language. Given below is the program designed to ent...

Q: I am working on creating a logical entity relationship diagram for my database class. I am wondering...

A: Although the full problem description is not given so deducing the problem / requirements from the d...

Q: How do you perform in Access?

A: MS Access is a database management system through which you can create, manipulate, maintain and del...

Q: create a python program that will ask users to input four different manufacturers of cars(e.g Ford, ...

A: Create a class Car and define _init_ () function which will initialize the value of variables manufa...

Q: what are some of the challenges that can face a firm to combine “a clear brand vision with a common ...

A: Introduction:The combination of clear brand vision of an organization with a common operating model ...