Mac Osxtopus
Registered
Im learning C++ from a book that addresses the ANCI ++ Standard(or something like that). Ive been trying to compile this program a while now and i cant find the problem. Here is the program: oops! i forgot this forum doesnt take gt's or lt's.
#include iostream //normal header files..
#include stdio.h
#include stdlib.h
using namespace std;
char name[10][80]; // where names are stored
char email[10][80]; // email adresses..
float rating[10][80]; // your rating of the person...
int menu();
void enterinfo(), report();
int main()
{
int choice;
cout << "Make a Decision: \n\n";
do {
choice = menu();
switch(choice) {// options...
case 0:
break;
case 1:
enterinfo();
break;
case 2:
return 0;
break;
default:
cout << "Invalid Input";
}
} while(choice!=0);
return 0;
}
int menu()
{
int choice;// the menu.... return the choice once its made.
cout << "1: Enter Information, then view it\n";
cout << "2: Quit";
cin >> choice;
return choice;
}
void enterinfo()
{
int i;
for(i=0; i<10; i++)
{
cout << "Enter The person's name here:\n";// this is where i get most of the errors....
cin >> name;
cout << "Now enter the person's e-mail:\n";
cin >> email;
cout << "Now, what is your rating(in a decimal number) of this person?";
cin >> rating;
cout << "This is what you have input into the program: \n";
report();
}
}
void report()
{
cout << "Name = " << name << '\n';
cout << "e-mail = " << email << '\n';
cout << "and finally, your rating of this person is:\n";
cout << rating[j] << '\n';
}
When i syntax check/build and run it gets errors in the HEADER FILES!! And i cant seem to get this fixed. All i simply want this to do is to store the information listed in these different arrays and then display them. Any help would be appreciated
#include iostream //normal header files..
#include stdio.h
#include stdlib.h
using namespace std;
char name[10][80]; // where names are stored
char email[10][80]; // email adresses..
float rating[10][80]; // your rating of the person...
int menu();
void enterinfo(), report();
int main()
{
int choice;
cout << "Make a Decision: \n\n";
do {
choice = menu();
switch(choice) {// options...
case 0:
break;
case 1:
enterinfo();
break;
case 2:
return 0;
break;
default:
cout << "Invalid Input";
}
} while(choice!=0);
return 0;
}
int menu()
{
int choice;// the menu.... return the choice once its made.
cout << "1: Enter Information, then view it\n";
cout << "2: Quit";
cin >> choice;
return choice;
}
void enterinfo()
{
int i;
for(i=0; i<10; i++)
{
cout << "Enter The person's name here:\n";// this is where i get most of the errors....
cin >> name;
cout << "Now enter the person's e-mail:\n";
cin >> email;
cout << "Now, what is your rating(in a decimal number) of this person?";
cin >> rating;
cout << "This is what you have input into the program: \n";
report();
}
}
void report()
{
cout << "Name = " << name << '\n';
cout << "e-mail = " << email << '\n';
cout << "and finally, your rating of this person is:\n";
cout << rating[j] << '\n';
}
When i syntax check/build and run it gets errors in the HEADER FILES!! And i cant seem to get this fixed. All i simply want this to do is to store the information listed in these different arrays and then display them. Any help would be appreciated