this is my code of McD simulation
but i can't find the error..
if can, i don't want the header file because its difficult for me to find the error..
1 C:\Dev-Cpp\include\c++\3.4.2\backward\iostream.h:31, from C:\Documents and Settings\Administrator\My Documents\datastructured\main.cpp In file included from C:/Dev-Cpp/include/c++/3.4.2/backward/iostream.h:31, from C:\Documents and Settings\Administrator\My Documents\datastructured\main.cpp
1 C:\Documents and Settings\Administrator\My Documents\datastructured\main.cpp from C:\Documents and Settings\Administrator\My Documents\datastructured\main.cpp
14 C:\Documents and Settings\Administrator\My Documents\datastructured\main.cpp `queue' has not been declared
14 C:\Documents and Settings\Administrator\My Documents\datastructured\main.cpp `queue' has not been declared
can someone solve my problem
this is my coding for main.cpp
#include <iostream.h>
#include <stdlib.h>
#include <time.h>
#include <conio.h>
#include <cstring>
#include <iomanip.h>
#include <fstream.h>
//#include "queue.h"
//#include "list.h"
using namespace std;
const int Total_Minutes=1440;
queue::queue() (const T &id ,const int a_time ,const int s_time)
{
//void Simulation ();
class McDonalds
{
private:
int Customer;
int Customer_Id;
int Arrival_Time;
int Current_Service_Time;
int Hour_Waiting_Time;
int Total_Customers;
int Insert_Node;
outFile<<"--------------------------------------------------------------"<<endl;
outFile<<" M C D O N A L D S "<<endl;
outFile<<"--------------------------------------------------------------"<<endl;
outFile<<" 2 4 - H o u r S i m u l a t i o n"<<endl;
outFile<<"--------------------------------------------------------------"<<endl<<endl;
outFile<<"=> TOTAL CUSTOMERS : "<<Customer_Id<<endl<<endl;
outFile<<"=> TOTAL WAITING TIME (in minutes) : "<<Total_Waiting<<endl<<endl;
outFile<<"=> TOTAL WAITING TIME (in hour) : "<<Total_Waiting/60<<endl<<endl;
outFile<<"=> AVERAGE WAITING TIME (per customer): "<<Average_Waiting_Time<<endl<<endl;
outFile<<"--------------------------------------------------------------"<<endl<<endl;
if ((Average_Waiting_Time)>3)
outFile<<"The management has to increase the number of counters"<<endl<<endl;
else
outFile<<"The management need not increase the number of counters"<<endl<<endl;
int main(int argc , char* args[])
{
if (argc<1)
{
cerr<<"INVALID NUMBER OF ARGUMENTS";
return 1;
}
/*open file stream for the input and output
ofstream outFile(args[1], ios::out);
checks that the output file is open or not
if (!outFile)
{
cerr<<"unable to open the output file"<<endl;
return 2;
}
*/
string line;
ifstream myfile1 ("queue.h");
if (myfile1.is_open())
{
while (! myfile1.eof() )
{
getline (myfile1,line);
cout << line << endl;
}
myfile1.close();
}
else cout << "Unable to open file";
string line;
ifstream myfile1 ("queue.h");
if (myfile1.is_open())
{
while (! myfile1.eof() )
{
getline (myfile1,line);
cout << line << endl;
}
myfile1.close();
}
else cout << "Unable to open file";
// McDonalds Customers;
// Customers.Simulation(outFile);
system ("pause");
return 0;
}
int class (int T, int List);
{
template <class T>
class List;
//-------------------------------- N O D E C L A S S -----------------------------------
void List<T> :: Delete_Node(const T &id)
{
if (Head==0)
{
cout<<"\n error : THE LIST IS EMPTY !";
}
else
{
Node<T> *Fatherptr=Head;
Node<T> *Sonptr=Head->next;
if (Fatherptr->Customer_Id==id)
{
Head=Head->next;
}
else
{
while (Sonptr!=NULL)
{
if (Sonptr->Customer_Id==id)
{
Fatherptr->next=Sonptr->next;
}
void List<T> :: Display_List(ofstream& outFile) const
{
if (Head==0)
outFile<<"error : THE LIST IS EMPTY ! \n";
else
{
Node<T> *currentptr=Head;
outFile<<"\n\n\t\tC U S T O M E R L I S T"<<endl;
outFile<<"\t\t------------------------"<<endl<<endl;
while (currentptr !=NULL)
{
outFile<<"Customer Id :"<<currentptr->Customer_Id<<endl;
outFile<<"---------------------"<<endl<<endl;
outFile<<"Arrival Time :"<<currentptr->Arrival_Time<<endl;
outFile<<"Service Time :"<<currentptr->Service_Time<<endl<<endl;
currentptr=currentptr->next;
}
}
}