Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

8. Write a program uses a counter-controlled do while loop that will count how m

ID: 3654229 • Letter: 8

Question

8. Write a program uses a counter-controlled do while loop that will count how many packages of Ramen noodles are free, based on the number of packages being purchased and the policy that every 5th package of Ramen noodles purchased is free. Remember to use a variable for a counter initialized to 1, a variable to hold the value of number of packages being purchased, a variable to count the number of free packages initialized to 0. Outside of the loop, prompt the user to enter how many packages of noodles are being purchased. Use this value to control when the loop ends. In the loop body, use a decision structure to determine if the counter mod 5 is equal to 0, if it is display

Explanation / Answer

#include int main() { int Packages=0,Count=0,i=1; cout
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote