CHRISTY
2011-12-12 18:59:25 UTC
I am working on a menu and am stuck with a linker error and cannot get any farther
I just need the menu and header files the .exe parts i have completed. teacher didn't go over header's, classes, and structures. the assignment is to create a menu driven program inside a function with switch with only two directives to call the function
menu has 5 options to open the following programs: Inventory.exe, orders.exe, shipping.exe, returns.exe, and the last to close the program with yes or no classes must be in external headers and included in project (yes i know the program file names are different in what I am pasting.
include one additional function in a separate header file the menu should open the .exe file allow you close it or run again and to return to the menu and choose another option. to exit the menu after choosing 5 it will ask for a confirmation.
be sure and validate your input
I welcome any further input on this being correct as i cannot see what is wrong because of the error and have a deadline due in an hour.
I will pastebin the external files
#include
#include
#include
#include
#include
using namespace std;
int menu()
{
int option;
cout << "Final Exam Program\n";
cout << "----------------------------\n";
cout << "1) Math Tutor\n";
cout << "2) File Processing\n";
cout << "3) Driver's License\n";
cout << "4) Inventory Class\n";
cout << "5) Exit\n\n";
cout << "Enter 1, 2, 3, 4, or 5: ";
cin >> option;
while (option < 1 || option > 6)
{
cout << "Invalid Selection\n";
cin >> option;
}
return option;
}
// Function prototypes
void openFile(fstream &);
int menu();
void file(fstream &);
int main()
{
int option;
fstream file;
openFile(file);
do
{
option = menu();
switch(option)
{
case 1 : fstream ("mathtutor.exe"); return 0;
break;
case 2 : fstream ("fileprocessing.exe"); return 0;
break;
case 3 : fstream ("driverslicense.exe"); return 0;
break;
case 4 : fstream ("inventoryclass.exe"); return 0;
break;
case 6 : cout << "Exiting program.\n\n";
}
} while (option != 5);
file.close();
return (0);
}