Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program IN JAVA that prompts the user for the wholesale price and markup percentage of an item. The program should invoke a method

Write a program IN JAVA that prompts the user for the wholesale price and markup percentage of an item. The program should invoke a method to calculate the retail price of the item.

You will need:

A scanner object to read the wholesale price and the markup percentage (Note: make sure you let the user know how the percentage should be entered. If it is in a percent format like 25% it would need to be converted to decimal for calculations. If the user entered it as a decimal format then no conversion is necessary.)

Variables to store:

a. The wholesale price (as a double)

b. The markup (as a double convert if entered as a %

c. (Optional: The retail price, which stores the returned retail value from the method. Keep in mind that you can use the method call directly in an output statement.)

3. A NumberFormat object to display the retail price in currency format (Optional: you can also create a format for the percentage, but it is not as important.)

A method that:

Accepts 2 parameters the wholesale price and markup percentage

Calculates the retail price

Returns the retail price value

Comments where necessary

A sample of the output is shown below:

Enter the item's wholesale cost: 60 Enter the item's markup percentage (as a %): 75 The item's retail price (at a 75% markup) is $105.00

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

Joe Celkos Data And Databases Concepts In Practice

Authors: Joe Celko

1st Edition

1558604324, 978-1558604322

More Books

Students also viewed these Databases questions

Question

3. How would this philosophy fit in your organization?

Answered: 1 week ago