I have a project due for my computer programming class on Monday, and though I've completed the majority of the program, I now have to loop it and have no idea how. Here is the program:
#include<iostream.h>
int add ();
int subtract ();
int multiply ();
int division ();
void menu ();
int main ()
{
menu ();
return 0;
}
int add ()
{
int x, y;
cout<<"So! You want to add. Cool.\n";
cout<<"enter two numbers.\n";
cin>>x>>y;
return (x+y);
}
int subtract ()
{
int x, y;
cout<<"You want to subtract? Stellar!\n";
cout<<"Please enter two numbers.\n";
cin>>x>>y;
return (x - y);
}
int multiply ()
{
int x, y;
cout<<"Multiplication is my fave!\n";
cout<<"Please enter two numbers.\n";
cin>>x>>y;
return (x * y);
}
int division ()
{
int x, y;
cout<<"Bleh, division. So tough, right?! Lucky the computer will be doing it for us!\n\n";
cout<<"Please enter two numbers!\n";
cin>>x>>y;
return (x/y);
Help would be greatly appreciated. I have to loop it so that it never really ends. I know that I should probably use a while loop, but I have no idea what the conditions would be. Thankyou!