Question
Write a java program that calculates sales price of each item. The sales price is calculated as follows: sales price = original price + (original
Write a java program that calculates sales price of each item. The sales price is calculated as follows:
sales price = original price + (original price x tax)
The tax rate is 5%. The program must design a single dimensional array to save all original price. Then, in Main() method, entire array and tax rate are passed to the static method. The method calculate sale price of each item. Your program must meet following requirements:
1. The program should declare one dimensional array to store original price of each item.
2. The size of an array should be determined by number of items. - it means that this is determined by user.
3. Prompt the user to input original price of each item and save it to the array.
4. The entire array and tax rate pass to the static method you defined.
5. The method calculates sales price of each item using above formula and display it on the screen.
should look like the picture.
ca C: WINDOWSAsystem32\cmd.exe How many Items do you have? 5 Enter the original price of item 1 $1.99 Enter the original price of item 2 $2.99 $5.50 Enter the original price of item 3 Enter the original price of item 4 $3.55 Enter the original price of item 5 $12.99 Sale Price of item 1 including tax $2.09 ale Price of item 2 including tax $3.14 ale Price of item 3 including tax: $5.78 ale Price of item 4 including tax $3.73 Sale Price of item 5 including tax $11.54 Press any key to continueStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started