summertime
2010-03-15 12:50:20 UTC
#include
#include
#include
using namespace std;
void newcourse();
void coursenum();
void print();
int main()
{
//Main menu
int option;
int x;
int y;
cout<<"Main menu:"<
cout << "Please select an option (1-4): ";
cin >> option;
if(option>=1 and option<=4){
if (option == 1)
{cout<< "1. Enter new course information"<
else if (option == 2)
{cout<<"2. Search a course by course number"<
return main();}
else if (option == 3)
{cout<<"3. Print a list of courses sorted by the course number"<
return main();}
else
{exit(4);}}
else
{cout << "Error: input data out of range"<
return 0;
}
void newcourse()
{//num-number of courses, name-instructorlastname, cap-capacity
string num[5];
string name[5];
int cap[5];
int x=100;
for(int i=0; i < x; i++){
cout << "course number (0 to exit): ";
cin>> num[i];
if( num[i] == "0"){
main(); }
cout<< "Instructor: ";
cin>> name[i];
cout<<"Capacity: ";
cin>>cap[i];
cout<< endl;}
}
I have made the function for newcourse() and im working on making the one for coursenum(). My problem is that i don't know how im supposed to get the input information from newcourse() into coursenum() so that i can do the search. any suggestions?idea? please and thank you!