Question: 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

1 Expert Approved Answer
Step: 1 Unlock

Your C code defines a fitness routine program that allows users to input the number of repetitions f... View full answer

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!