Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

D I AM ABLE TO RUNIT WITH OUT ERRORS> #include using namespace std; // Function to perform Warm-up exercise void performWarmUp(int warmUpReps) { cout <

D I AM ABLE TO RUNIT WITH OUT ERRORS>

#include


using namespace std;




// Function to perform Warm-up exercise


void performWarmUp(int warmUpReps) {


cout << "*** Warm-up Section ***" << endl;


for (int i = 1; i <= warmUpReps; i++) {


cout << "Warm-up repetition " << i <

" complete." << endl;


}


}




// Function to perform Cardio exercise


void performCardio(int cardioReps) {


cout << "*** Cardio Section ***" << endl;


for (int i = 1; i <= cardioReps; i++) {


cout << "Cardio repetition " << i << " complete." << endl;


}


}




// Function to perform Cool-down exercise


void performCoolDown(int coolDownReps) {


cout << "*** Cool-down Section ***" << endl;


for (int i = 1; i <= coolDownReps; i++) {


cout << "Cool-down repetition " << i << " complete." << endl;


}


}




int main() {


cout << "Fitness Routine" << endl;


char continueExercise = 'y';




do {


int warmUpReps, cardioReps, coolDownReps;




cout << "Enter the number of repetitions for Warm-up: ";


cin >> warmUpReps;


cout << "Enter the number of repetitions for Cardio: ";


cin >> cardioReps;


cout << "Enter the number of repetitions for Cool-down: ";


cin >> coolDownReps;




performWarmUp(warmUpReps);




cout << "Do you want to continue to the Cardio section? (y/n): ";


cin >> continueExercise;




if (continueExercise != 'y') {


cout << "Fitness routine completed. Goodbye!" << endl;


break;


}




performCardio(cardioReps);




cout << "Do you want to continue to the Cool-down section? (y/n): ";


cin >> continueExercise;




if (continueExercise != 'y') {


cout << "Fitness routine completed. Goodbye!" << endl;


break;


}




performCoolDown(coolDownReps);




cout << "Do you want to continue exercising? (y/n): ";


cin >> continueExercise;




} while (continueExercise == 'y');




cout << "Fitness routine completed. Goodbye!" << endl;


return 0;


}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

Your C code defines a fitness routine program that allows users to input the number of repetitions f... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

C++ Primer Plus

Authors: Stephen Prata

6th Edition

978-0321776402, 0321776402

More Books

Students also viewed these Programming questions

Question

Subtract the polynomials. (-x+x-5) - (x-x + 5)

Answered: 1 week ago

Question

What doesnt a derived class inherit from a base class?

Answered: 1 week ago