ok so heres my script

#include <iostream>
using namespace std;


using namespace std;
int Unitedstates()
{
int action;
char action1;
cout << "you have chosen to learn more about the united states. Now What will you do?" << endl;
cout << "1. The quality of doctors in the United States." << endl;
cout << "2. What happens when a doctor commites malpractice." << endl;
cout << "3. Average salery of doctors." << endl;
cout << "4. Practices in  the United States." << endl;
cin >> action;
if (action == 1){
           cout << "Coming soon" << endl;
           }
else if (action == 2){
     cout << "coming soon" << endl;
     }
else if (action == 3){
     cout << "the average salery is $100,000 a year." << endl;
     }
else if (action == 4){
cout << "coming soon" << endl;
}
else {cin >> action;}
} 
     
int Europe(){
int action;
char action1;
cout << "You have chosen to learn more about Medecine in Europe." << endl;  
cout << "Now what do you want to learn about?" << endl;
cout << "1. The quality of doctors in Europe." << endl;
cout << "2. What happens when a doctor commites malpractice." << endl;
cout << "3. Average salery of doctors." << endl;
cout << "4. Practices in  the United States." << endl;
cin >> action;
if (action== 1){
cout << "coming soon" << endl;
cout << "to go back to the main menu, press 1, and then enter." << endl;
cin >> action;
if (action == 1)
cout << Mainmenu();
else cin >> action;
}
else if (action == 2){
cout << "coming soon" << endl;
cout << "to go back to the main menu, press 1, and then enter." << endl;
cin >> action;
if (action == 1)
cout << Mainmenu();
else cin >> action;
}
else if (action == 3){
cout << "coming soon" << endl; 
cout << "to go back to the main menu, press 1, and then enter." << endl;
cin >> action;
if (action == 1)
cout << Mainmenu();
else cin >> action;
} 
else if (action == 4){
cout << "coming soon" << endl;
cout << "to go back to the main menu, press 1, and then enter." << endl;
cin >> action;
if (action == 1)
cout << Mainmenu();
else cin >> action;
     }
else cin >> action;    
}

int Mainmenu(){
int action;
char action1;
 cout << "Welcome to my Quarter Project." << endl;
 cout << "What would you like to learn more about?" << endl; 
 cout << "1. Medecine in the United States." << endl;  
 cout << "2. Medecine in Europe." << endl;
 cout << "3. Medecine in China." << endl;
 cout << "4. Medecine in Australia." << endl;  
 cout << "5. Medecine in Africa." << endl;  
 cout << "6. Medecine in Brazil." << endl;  
 cin >> action;
 if (action == 1)cout << Unitedstates();
 else if (action == 2) cout << Europe();
else {cin >> action;}    
    
    
    
}




int main()
{
int action;
char action1;
cout << Mainmenu();

 system("pause");
 return 0;   
    
}

i dont get how i would fix this...
these are the errors

function `int Europe()':

54 `Mainmenu' undeclared (first use this function)

(Each undeclared identifier is reported only once for each function it appears in.)

In function `int Mainmenu()':

76 `int Mainmenu()' used prior to declaration

Edited 6 Years Ago by skorm909: n/a

functions have to be declared before they can be used. Put int Mainmenu(); somewhere near the top of the program (such as between lines 5 and 6). That is called a function prototype.

Edited 6 Years Ago by Ancient Dragon: n/a

thanks =)
ok but now i have a question... when i use this script, it just keeps putting the information down, and the previous information stays up there, how do i make it so after every thing i do that previous text goes away?

if you were to run this program then choose europe, the "mainmenu"
stays there.. how do i get that to go away after i choose what i want?

This article has been dead for over six months. Start a new discussion instead.