Current location: Hot Scripts Forums » Programming Languages » C/C++ » help me plzzzzzzzzzzzzzzzzzzzzzzzzzzzz


help me plzzzzzzzzzzzzzzzzzzzzzzzzzzzz

Reply
  #1 (permalink)  
Old 11-17-04, 03:41 AM
toyyo toyyo is offline
New Member
 
Join Date: Nov 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Unhappy help me plzzzzzzzzzzzzzzzzzzzzzzzzzzzz

hi everyone

this is my question , i need to do program that regist passenger and then at the end the program should print the table of all register .. can you help on this .. i don't know even where should i start???

help me plz plz plz

thanx any way...
Reply With Quote
  #2 (permalink)  
Old 11-18-04, 08:06 AM
wizkid's Avatar
wizkid wizkid is offline
Newbie Coder
 
Join Date: Nov 2004
Posts: 57
Thanks: 0
Thanked 0 Times in 0 Posts
Is this a classroom requirement?
Reply With Quote
  #3 (permalink)  
Old 11-18-04, 04:17 PM
toyyo toyyo is offline
New Member
 
Join Date: Nov 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
yes it is ... do u wanna help or not??
Reply With Quote
  #4 (permalink)  
Old 11-19-04, 09:13 AM
wizkid's Avatar
wizkid wizkid is offline
Newbie Coder
 
Join Date: Nov 2004
Posts: 57
Thanks: 0
Thanked 0 Times in 0 Posts
Start something and I will see what I can do. Post your code here.
Reply With Quote
  #5 (permalink)  
Old 11-19-04, 04:08 PM
toyyo toyyo is offline
New Member
 
Join Date: Nov 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
ok .. this is my code ..

-----------------------------------------------------------------
#include <iostream.h>


void table (char[29],int[29],int[29]);


int main ()
{

char Pname[29];
int flightN [29];
int classtype[29];
int smokeYN[29];
int x;



for (int j=0; j<30; j++)
{
cout<<"Please, Enter your first name "<<endl;
cin>>Pname[j]; //passenger name

cout<<"Please, Enter the flight you want : 1,2 , or 3"<<endl;
cin>>flightN[j]; //flight number

cout<<"Do you prefer to regist in first class or economy class ?"<<endl;
cout<<"1 for yes, 2 for no"<<endl;
cin>>classtype[j];
cout<<"That will cost $1200, is this ok to your finance?"<<endl;
cout<<"1 for yes, 2 for no"<<endl;
cin>>x;

if (x==1)
cout<<"Man! you really seem to be so rich"<<endl;
else
cout<<"I thought so, this will cost $800"<<endl;


cout<<"Do you want a smoker's seat\n 1 for yes, 2 for no "<<endl;
cin>>smokeYN[29];

}

table (Pname[],flightN[29],classtype[29]);

cout<<" Thanks for travelling with SMILE Airlines "<<endl;

return 0;

}



void table (char name[29],int flightNum[29],int classtype[29] )
{

int ticketPrice[29];
int smoke[29];
int i=0;


cout<<"Flight Number"<<"\t"<<"Seat Number"<<"\t"<<"Name"<<"\t"<<"Class Type"<<"\t"<<"Ticket Price"<<"\t"<<"Smoke"<<endl;
cout<<"-------------------"<<endl;


cout<<flightNum[i]<<"\t"<<i<<"\t"<<name[i]<<"\t"<<classtype[i]<<"\t"<<ticketPrice[i]<<"\t"<<smoke[i]<<endl;

cout<<"------------"<<endl;

} //end of function definition

-------------------------------------------------------------------------
this program doesn't working there is a mistake, i couldn't fix it ..
--------------------Configuration: project - Win32 Debug----
Compiling...
project.cpp
C:\Documents and Settings\dm com\Desktop\mariam\tables\project\project.cpp(44) : error C2059: syntax error : ']'
Error executing cl.exe.

project.exe - 1 error(s), 0 warning(s)
-------------------------------------------------

i am waiting your reply ..
Reply With Quote
  #6 (permalink)  
Old 11-23-04, 03:13 PM
vek vek is offline
Newbie Coder
 
Join Date: Oct 2004
Location: Florence, Ky
Posts: 35
Thanks: 0
Thanked 0 Times in 0 Posts
Code:
#include <iostream.h>

void table (char[][], int[], int[]);

int main ()
{
   char Pname[29][80];
   int flightN [29];
   int classtype[29];
   int smokeYN[29];
   int x;

for (int j=0; j<30; j++)
{
cout<<"Please, Enter your first name "<<endl;
cin>>Pname[j]; //passenger name

cout<<"Please, Enter the flight you want : 1,2 , or 3"<<endl;
cin>>flightN[j]; //flight number

cout<<"Do you prefer to regist in first class or economy class ?"<<endl;
cout<<"1 for yes, 2 for no"<<endl;
cin>>classtype[j];
cout<<"That will cost $1200, is this ok to your finance?"<<endl;
cout<<"1 for yes, 2 for no"<<endl;
cin>>x;

if (x==1)
   cout<<"Man! you really seem to be so rich"<<endl;
else
   cout<<"I thought so, this will cost $800"<<endl;
 

cout<<"Do you want a smoker's seat\n 1 for yes, 2 for no  "<<endl;
cin>>smokeYN[29];

}

table (Pname,flightN,classtype);

cout<<":) Thanks for travelling with SMILE Airlines :)"<<endl;

return 0;

}



void table (char name[][],int flightNum[],int classtype[] )
{
	int ticketPrice[29];
	int smoke[29];
	int i=0;

	cout<<"Flight Number"<<"\t"<<"Seat Number"<<"\t"<<"Name"<<"\t"<<"Class Type"<<"\t"<<"Ticket Price"<<"\t"<<"Smoke"<<endl;
	cout<<"-------------------"<<endl;


	cout<<flightNum[i]<<"\t"<<i<<"\t"<<name[i]<<"\t"<<classtype[i]<<"\t"<<ticketPrice[i]<<"\t"<<smoke[i]<<endl;

	cout<<"------------"<<endl;

}	//end of function definition
Try that... Don't really have a c++ compiler, so I'm not sure about the 2 dim array
Reply With Quote
  #7 (permalink)  
Old 11-23-04, 04:27 PM
Sabu Sabu is offline
Junior Code Guru
 
Join Date: Sep 2004
Posts: 458
Thanks: 0
Thanked 0 Times in 0 Posts
I find it beyond hilarious that wizkid instantly knew it was a classroom requirement

Quote:
plz plz plz
is a universal way to annoy people into compliance, I suppose
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump


All times are GMT -5. The time now is 04:33 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.