Reference no: EM132171549
using jGRASP i need the code to run this program
Retail Price Calculator
Write a program 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