Question: how can I get a selected a number 1-4 to loop until an valid number is entered to start the program. #include #include using namespace
how can I get a selected a number 1-4 to loop until an valid number is entered to start the program.
#include
int main() { float Gold = 0.01; float Silver = 0.02; float Bronze = 0.04; float limit = 10; float baseFee = 1200.00; const int years = 10; double choice; cout<< fixed << setprecision(2); cout << "Welcome to Ronda's Strikeforce Gym!!!" << endl; cout << "x---------------------------------------x" << endl; cout << "1. Gold" << endl; cout << "2. Silver" << endl; cout << "3. Brozne" << endl; cout << "4. Quit" << endl; cout << "Please enter your membership level (1-3 Enter 4 to Quit) > "; cin >> choice; while ( choice >=5 ); if(choice == 1) { for (int i = 1; i <= 1; i++) cout << "Year 1 "<< (baseFee * Gold * 100 )< if (choice >= 5) { cout << "You entered an invalid number."<< endl; cout << "Please enter a number from 1-4"; } }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
