subject

Assignment #3 – Grocery Shopping v2:
In this assignment you are going to modify “Assignment #2 – Grocery Shopping” program. The new version of the program will perform the same task with the same items and prices as the older version. (I have noticed that shipping rates doesn’t make sense business wise since you pay more shipping when you purchase more. Though, I will keep it as it is.)
Follow the Steps Below
1. You must have done Assignment #2. I will try to complete grading and giving feedback as soon as possible, so you can check and fix what you are missing for the assignment. You can still ask your questions before my feedback.
2. Save the project as A3_Grocery_v2_yourname.
3. Use functions to divide your program into manageable pieces. Define three functions: displayMenu, tipCalculator, and shippingCalculator.
a. Write function prototypes at the top and define the functions after the main function.
4. displayMenu function:
a. Move the code that displays the menu in the program into the function.
b. Whenever you need to display the menu, call the function.
5. tipCalculator function:
a. Move the code that asks users if they want to add a tip and calculate the subtotal accordingly, into the function.
b. Call the function in an appropriate place in the main menu. Pass the value of subtotal to the function when calling. Return the value of new subtotal from the function.
c. Write appropriate return type and parameter list for the function.
Optional: You may ask the user how much money they would like to tip.
6. shippingCalculator function:
a. Move the code that calculates the total including a shipping rate based on the subtotal, into the function.
b. Call the function in an appropriate place in the main menu. Pass the value of subtotal to the function when calling. Return the value of shipping added total from the function.
c. Write appropriate return type and parameter list for the function.
7. Define constants as global constants.
8. Keep variable definitions local.
9. At the beginning of the program display the menu, then ask the user if they want to give an order.
10. If the answer is no, exit the program with the exit() function.
11. Use while loop when the answer is yes in order to ask user if they want to give another order. Then, you can go through the process again and receive a new order. The subtotal will be accumulator of the while loop that keeps adding the cost of the new orders.
The program should let user to give another order until they enter “no”.
12. Use do-while loop to check if the user’s item choice is valid. Display menu and ask user to make a valid choice until their choice is valid. If their choice is invalid, display a warning message. Once the choice is valid, you can terminate the loop and continue with the switch statement. (do-while loop will be used inside the while loop.)
13. Use the following output screen images as a guide.

14. Use comment lines to describe block of code statements in the program.

You must submit both files (zipped project folder and .cpp extension) of the program.
Rubric
• Complete and working program with correct calculations and no errors. (5 points)
• Code readability with indentations, spaces when necessary (4 points)
• Comment lines for description (4 points)
• Local variable definitions in the appropriate function. (5 points)
• Global constants definition (5 points)
• Function prototypes (9 points)
• Proper function calls (9 points)
• Functions header and body (27 points)
• While loop. (10 points)
• Do-while loop. (10 points)
• If statements to give user a message when the loop conditions are false. (5 points)
• User interaction with displaying proper messages. (3 points)
• Exit function (4 points)

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 06:00
What role do chromosomes play in inheritance?
Answers: 1
question
Computers and Technology, 22.06.2019 07:20
Write a pseudocode solution for each of these problems. 1. design a while loop that lets that user enter a number. the number should be multiplied by 10, and the result stored in a variable named product. the loop should iterate as long as product contains a value less than 100. 2. design a do-while loop that asks the user to enter two numbers. the numbers should be added and the sum displayed. the loop should ask the user whether he or she wishes to perform the operation again. if so, the loop should repeat; otherwise it should terminate. 3. design a for loop that displays the following set of numbers: 0, 10, 20, 30, 40, 50 100. 4. design a nested loop that displays 10 rows of # characters. there should be 15 # characters in each row. 5. convert this for loop to a while loop. declare integer count for count = 1 to 50 display count end for 6. find the error in the following pseudocode. declare boolean finished = false declare integer value, cube while not finished display “enter a value to be cubed.” input value; set cube = value ^ 3 display value, “ cubed is “, cube end while
Answers: 2
question
Computers and Technology, 22.06.2019 21:50
Given int variables k and total that have already been declared, use a while loop to compute the sum of the squares of the first 50 counting numbers, and store this value in total. thus your code should put 11 + 22 + 33 + + 4949 + 50*50 into total. use no variables other than k and total.
Answers: 2
question
Computers and Technology, 23.06.2019 12:00
If you're using an existing powerpoint presentation that will receive new slides based on a word outline, select the a. slide that will appear after the new slides. b. first slide in the presentation. c. slide that will appear before the new slides. d. last slide in the presentation.
Answers: 2
You know the right answer?
Assignment #3 – Grocery Shopping v2:
In this assignment you are going to modify “Assignment #2...
Questions
Questions on the website: 13722362