Hello, I am struggling on this part of my program. It says: You should have a function, let’s call it MakeSale(), that accepts no arguments and returns the total amount of the sale (including tax). All the input needed to make a sale should be requested from user inside MakeSale() function.
So far this is what I have. I am unsure how to return my total value so that it adds up the amount of items that the user has entered. Basically, I need "Item Price Tax: $" and "Price of Weighted Item: $" to add up within the MaleSale () function. Any suggestions would be helpful.
So basically take all you have in choice == 1 and put it into the function. Then when the choice == 1, then call the function and have it equal to a double variable (since the function is returning a double). Then print out this variable like you originally have it at the end of choice == 1.
Mostly, you would want to return the total of the computeprice and tax in the return statement. Then you would want to use that by printing it out in a cout statement.