Been working on this project for the past two days and tried googling for solutions and about every 5th solution led me here, so I decided to join and see if I could get my question answered.
Here's what I need to do, this is a semester long project for creating a menu system for a fictional bookstore. Up until now, every screen has been its own separate project, this week, we need to hook up everything to the main menu screen.
Now, for a parameter, my professor forced us to make it a multi file program instead of throwing everything together in a switch statement and making life easier. Everything is written, and my problem is modifying the switch statement towards the end to access the other files
#include <iostream>
#include <fstream>
#include "bookinfo.h"
#include "cashier.h"
#include "invmenu.h"
#include "reports.h"
using namespace std;
int main()
{
ofstream outputFile;5
ifstream inputFile;
int choice;
do
{
cout << "\n" << "\t\t\tSerendipity Booksellers" << "\n\n\n";
cout << "\t\t\t\tMain Menu" << "\n\n\n";
cout << "\t\t\t1.Cashier Module" << "\n";
cout << "\t\t\t2.Inventory Database Module" << "\n";
cout << "\t\t\t3.Report Module" << "\n";
cout << "\t\t\t4.Exit" << "\n\n\n";
cout << "\t\t\tEnter Your Choice:";
cin >> choice;
while (choice < 1 || choice > 4)
{
cout << "Please Enter a number between the range 1-4.\n";
cout << "Enter Your choice:";
cin >> choice;
}
switch (choice)
{
case '1': outputFile.open("C:\\Users\\Owner\\Desktop\\Documents\\C++ Projects\\Assignments\\Serendipity\\Main Menu Screen\\Main Menu Screen\\Cashier Screen.cpp");
if (!inputFile)
cout << "Error Opening file.\n";
break;
case '2': invmenu();
break;
case '3': reports();
break;
case '4': cout << "\n\t\t\tEnding Program.\n";
break;
}
}while (choice != 4);
return 0;
}
Any help would be much appreciated.