Question: Develop a program that will be used to receive 5 gift prices from the user and calculate and display a 5 % sales tax for

Develop a program that will be used to receive 5 gift prices from the user and calculate and displaya 5%sales tax for each item.
Make sure to use the features described below in the details section.
Sample output (blue text is printed by your program, red is user input):
Enter a gift price: 100.23
Enter a gift price: 1.99
Enter a gift price: 56.78
Enter a gift price: 299.99
Enter a gift price: 80.65
Sales Tax on gift items:
$5.01
$0.10
$2.84
$15.00
$4.03
Details: Your program should createan array ofdoubles that will be used to hold5 gift prices. Populate the array by using a forloop to iteratively prompt the user for a gift price and read in the user's response to an item in the array. At the end of the loop, the array will hold 5 values as provided by the user. At this point in your program, invoke (i.e. call) a method to calculate and display a 5% sales tax for every item in the array. The method that you use to do this (you could call it PrintSalesTax) should accept your array of prices as an argument and use an enhanced for loop to iterate through the items and calculate and display the sales tax.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!