int main()
{
char input;
int x=0;
int y=0;
//Display Welcome message
cout << "Welcome to the Math Study Guide!";
cout << "Which arithmetic table would you like to see?!";
do
{//displaying the menu
cout << "1 Addition";
cout << "2 Substraction";
cout << "3 Multiplication";
cout << "4 Division";
cout << "X Exit the program";
cout << ">>";
cin >> input;
// if user response is valid:
{if (input == '1' || input == '2' || input == '3' || input == '4')
cout <<"Please enter the dimensions (eg: 4 4):";
x = cin >> ();
y = cin >> ();
// validate the x and y values
while(x <= 0 || y <= 0)
{
cout<< "You have entered an invalid dimension. Please enter a value greater than 0 for both dimensions.";
cout << "Please enter the dimensions of the table (eg: 4 4): ";
x = cin >>int();
y = cin >> int();
#include <iostream>
usingnamespace std;
int main()
{
char input;
int x=0;
int y=0;
//Display Welcome message
cout << "Welcome to the Math Study Guide!\n";
cout << "Which arithmetic table would you like to see?!\n"; // add newline on end
do
{
cout << "1 Addition\n";
cout << "2 Substraction\n";
cout << "3 Multiplication\n";
cout << "4 Division\n";
cout << "X Exit the program\n";
cout << ">>\n";
cin >> input;
if (input == 'X'){
return 0;
}
}while(!(input == '1' || input == '2' || input == '3' || input == '4'));
// check if the input is valid or not, if it isn't , repeat
while (1){
cout << "Choose x: \n";
cin >> x;
cout << "Choose y: \n";
cin >> y;
if (x <= 0 || y <= 0){
cout << "You have entered an invalid dimension. Please enter a value greater than 0 for both dimensions.\n";
cout << "Please enter the dimensions of the table (eg: 4 4): \n";
}
else{
break; // break out of loop
}
}
} // ending int main ()
I have some other issues, if you could help me that would be great. For some reason the code tag isnt working for me but here is the link to the full question!