0

hi and hello....
I'm a class XII student of CBSE board.we have to do a project in C++ in CS for the board evaluation....so i've chosen 'Airline Reservation Forum'.....i'm posting it and i want to hear to all valuble suggestions to make my project better..

(pls do find the attachment.....)
with regards,
sundar

Attachments
#include <iostream.h>
#include <conio.h>
#include <process.h>
#include <time.h>
#include <graphics.h>
#include <stdio.h>

void display1(void) 	    //welcome screen pro
{
	textmode(BW40);
	cout<<"\n\n\n\n\n\n\n\n\t     VSV AIRLINES	\t\t\t\t\t\t";
	cout<<"\n    (AIRLINE RESERVSTION DATA BASE)";
	cout<<"\n\n\n\n\n\n\n\n\nProject By: "<<"\nV.Vidyasagar"<<"\nJ.Vittaldeep";
	cout<<"\nM.N.Sundar";
	cout<<"\nCLASS:XII";
	cin.get();
}

void timex(void)                   //for showing time when user opens application
{
	time_t t;
	time(&t);
	printf("\n%s", ctime(&t));
}

void display2(void)	      //menu screen
{
	textmode(BW80);
	cout<<"\t\t\t\tVSV AIRLINES ";
	timex();
	cout<<"\nWelcome Dear Guest,";
}

void display3(void)                       //different infos for user
{
	textcolor(RED + BLINK);
	textbackground(DARKGRAY);
	cout<<"\n\n\t\t\t\t\t\t";
	cout<<"\rYOU WANT TO TRAVEL\t\t\t\t";
	cprintf("FLIGHTS OFFERED");
	textcolor(GREEN + BLINK);
	textbackground(LIGHTBLUE);
	cout<<"\n\t\t\t\t\t\t";
	cout<<"\rFROM:\t\t\t\t\t\t";
	cprintf("BOEING-747");
	cout<<"\n\t\t\t\t\t\t";
	cout<<"\rBANGALORE\t\t\t\t\t";
	cprintf("AIRBUS-320");
	cout<<"\n\t\t\t\t\t\t";
	cprintf("AIRBUS-380");
	cout<<"\n\rTo  :\t\t\t\t\t\t";
	textcolor(LIGHTMAGENTA+BLINK);
	textbackground(BLACK);
	cprintf("\n\r1.CHENNAI");
	textcolor(BROWN+BLINK);
	cprintf("\n\r2.THIRUVANANTHAPURAM");
}

char x;
int n;
char name[31];

void dispchennai(void)               //to display details of flights to chennai
{
	int ch1;
	cout<<"\nFLIGHTS TO CHENNAI:";
	cout<<"\n\rFLIGHT NAME\t  DEPARTURE\t  ARRIVAL\t  COST(Per Person)"<<endl;
	cout<<"\n\r1.Ft1011   \t    8:30   \t   9:50  \t   Rs.750+2655tax=Rs.3405";
	cout<<"\n\r2.Ft2987   \t   11:45   \t  13:05  \t   Rs.650+2301tax=Rs.2951";
	cout<<"\n\r3.Ft3465   \t   14:00   \t  15:20  \t   Rs.575+2036tax=Rs.2611";
	cout<<"\n\n\rPLEASE ENTER A CHOICE(1/2/3): ";
	cin>>ch1;
	cout<<"\nWOULD YOU LIKE TO CONFIRM IT(y/n): ";
	cin>>x;
	if(x=='y' || x=='Y')
	{
		switch(ch1)
		{
			case 1:

				cout<<"\nPLEASE ENTER NO. OF PERSONS"<<"\nTRAVELLING\t\t\t  :";
				cin>>n;
				cout<<"\nPLEASE ENTER NAME(S) BELOW."<<endl;
				for(int i=0;i<n;++i)
				{    cout<<i+1<<".";
				     cin>>name;
				}
				cout<<"\nTOTAL COST OF THE TRIP:Rs. "<<n*3405<<"/-";
				cout<<"\n(Press Enter to recieve your ticket)";
				getch();
				break;
			case 2:
				cout<<"\nPLEASE ENTER NO. OF PERSONS"<<"\nTRAVELLING\t\t\t  :";
				cin>>n;
				cout<<"\nPLEASE ENTER NAME(S) BELOW."<<endl;
				for(i=0;i<n;++i)
				{    cout<<i+1<<".";
				     cin>>name;
				}
				cout<<"\nTOTAL COST OF THE TRIP:Rs. "<<n*2951<<"/-";
				cout<<"\n(Press Enter to recieve your ticket)";
				getch();
				break;
			case 3:
				cout<<"\nPLEASE ENTER THE NO. OF PERSONS"<<"\nTRAVELLING\t\t\t  :";
				cin>>n;
				cout<<"\nPLEASE ENTER NAME(S) BELOW."<<endl;
				for(i=0;i<n;++i)
				{    cout<<i+1<<".";
				     cin>>name;
				}
				cout<<"\nTOTAL COST OF THE TRIP:Rs. "<<n*2611<<"/-";
				cout<<"\n(Press Enter to recieve your ticket)";
				getch();
				break;
			default:
				cout<<"\nSorry wrong choice.Terminating.";
				getch();
				exit(0);


		}
	}
	else
	cout<<"\nSorry Terminating.";
	getch();
	exit(0);


}

void disp_trivandrum(void)           //to display details of flights to trivandrum
{
	int ch2;
	cout<<"\nFLIGHTS TO THIRUVANANTHAPURAM:";
	cout<<"\n\rFLIGHT NAME\t  DEPARTURE\t  ARRIVAL\t  COST(Per Person)"<<endl;
	cout<<"\n\r1.Ft9421   \t    7:20   \t   8:45  \t   Rs.725+2557tax=Rs.3292";
	cout<<"\n\r2.Ft8001   \t   10:05   \t  11:30  \t   Rs.625+2213tax=Rs.2838";
	cout<<"\n\r3.Ft6237   \t   13:00   \t  14:25  \t   Rs.550+1947tax=Rs.2497";
	cout<<"\n\n\rPLEASE ENTER A CHOICE(1/2/3): ";
	cin>>ch2;
	cout<<"\nWOULD YOU LIKE TO CONFIRM IT(y/n): ";
	cin>>x;
	if(x=='y' || x=='Y')
	{
		switch(ch2)
		{
			case 1:

				cout<<"\nPLEASE ENTER THE NO. OF PERSONS"<<"\nTRAVELLING\t\t\t  :";
				cin>>n;
				cout<<"\nPLEASE ENTER NAME(S) BELOW."<<endl;
				for(int i=0;i<n;++i)
				{    cout<<i+1<<".";
				     cin>>name;
				}
				cout<<"\nTOTAL COST OF THE TRIP:Rs. "<<n*3292<<"/-";
				cout<<"\n(Press Enter to recieve your ticket)";
				getch();
				break;
			case 2:
				cout<<"\nPLEASE ENTER THE NO. OF PERSONS"<<"\nTRAVELLING\t\t\t  :";
				cin>>n;
				cout<<"\nPLEASE ENTER NAME(S) BELOW."<<endl;
				for(i=0;i<n;++i)
				{    cout<<i+1<<".";
				     cin>>name;
				}
				cout<<"\nTOTAL COST OF THE TRIP:Rs. "<<n*2838<<"/-";
				cout<<"\n(Press Enter to recieve your ticket)";
				getch();
				break;
			case 3:
				cout<<"\nPLEASE ENTER THE NO. OF PERSONS"<<"\nTRAVELLING\t\t\t  :";
				cin>>n;
				cout<<"\nPLEASE ENTER NAME(S) BELOW."<<endl;
				for(i=0;i<n;++i)
				{    cout<<i+1<<".";
				     cin>>name;
				}
				cout<<"\nTOTAL COST OF THE TRIP:Rs. "<<n*2467<<"/-";
				cout<<"\n(Press Enter to recieve your ticket)";
				getch();
				break;
			default:
				cout<<"\nSorry wrong choice.Terminating.";
				getch();
				exit(0);


		}
	}
	else
	cout<<"\nSorry Terminating.";
	getch();
	exit(0);


}

void display4(int ch)
{
	clrscr();
	switch(ch)
	{
		case 1:
			dispchennai();
			break;
		case 2:
			disp_trivandrum();
			break;
		default:
			cout<<"Invalid Choice.Sorry Terminating.";
			getch();
			exit(0);
	}


}

int main()
{
	clrscr();
	int ch;
	display1();
	display2();
	display3();
	textcolor(YELLOW);
	cprintf("\n\n\n\n\rPLEASE ENTER CHOICE(1/2): ");
	cin>>ch;
	display4(ch);

	getch();
	return 0;
}
2
Contributors
1
Reply
3
Views
9 Years
Discussion Span
Last Post by Salem
0

http://en.wikipedia.org/wiki/Central_Board_of_Secondary_Education
Ah yes, the bunch of xxxxx who insist on teaching "c" using a compiler which became obsolete a full 20 YEARS ago. It's not like there's a shortage of high quality, free and most importantly up to date compilers to choose from.

This is why I don't worry about out-sourcing. The entire continent is full of programmers with skills so far out of date with the modern world as to be useless.

Lets see.
If this is a C++ program, where are the classes?
Why so many global variables?
Why so many variables with short meaningless names?
Why do so few functions have parameters?
Why are functions like display1() display2() totally meaningless descriptions of their function?
Why the chaotic mix of cout and cprintf?
Why is code for say inputting a traveller name duplicated (and not a function)
Why is the penalty for incorrect input so harsh (being dumped out of the program)?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.