944,144 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 11236
  • C++ RSS
You are currently viewing page 1 of this multi-page discussion thread
May 10th, 2006
0

plz help(Airline Reservation System)

Expand Post »
hi every one

iam new member in your sites

and i hope i will find what iam looking for:rolleyes:

so my friends i really want ur help

iam students in univerisity 3rd level and our teacher ask us to write program in c++

this one below


{
Develop an Airline Reservation System in which five arrays are maintained. The first array has the names of the customers, the second array has the number of seats the customer wants, the third array has the destination city of customer, the fourth array has the amount he has paid, and the fifth array has information about whether the customer’s reservation is confirmed or not – so this fifth array can have values either ‘confirmed’ or ‘unconfirmed’. Your program should read arbitrary data from an input file "reservations.txt", and then displays a menu with the following options:

1. Add a new reservation
2. Show details of a reservation (given reservation number)
3. Make Payment (given the reservation number and payment amount)
4. Confirm a Reservation (given the reservation number)
5. Quit

The index of the array should be taken as the Reservation number. So for example if you want to check or update any information related to reservation number 3, then you can actually work with the values in the third index of all the arrays. If you add a new reservation, then obviously a new reservation number will be generated as you will add a new index in all the arrays.
When your program is quit you should make sure that before quitting all the changes in the arrays are written into the “reservation.txt� – Basically all information in “reservation.txt� should be updated according to all activities done in your program, e.g. adding a new reservation, making payment and confirming reservation.

You should apply modular programming, with a separate function for each major task in your program.
}

so iam really want ur help in that

and thank u very much

and this is my e-mail
(hot_sun_03@hotmail.com)
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
wwaall2004 is offline Offline
7 posts
since May 2006
May 10th, 2006
0

Re: plz help(Airline Reservation System)

We are not here to do your homework. Let's start with how you have thought of approaching the problem first. We will be helping you on the way.
Reputation Points: 48
Solved Threads: 7
Posting Whiz
aniseed is offline Offline
353 posts
since Apr 2006
May 10th, 2006
0

Re: plz help(Airline Reservation System)

Reputation Points: 48
Solved Threads: 7
Posting Whiz
aniseed is offline Offline
353 posts
since Apr 2006
May 10th, 2006
0

Re: plz help(Airline Reservation System)

ok

i will start....

#include <stdio.h>
#include<stdlib.h>
#include<string.h>
void main (void)
{
int x , a ,z,b,A,c;
int names[], number of seats[], 
destination city[], payment[], info[];
 
FILE *reservations;
first = fopen("reservations.txt","r");
 
printf("Welcome to Airline Reservation System. \n");
printf("******************************************************************\n");
Reputation Points: 10
Solved Threads: 0
Newbie Poster
wwaall2004 is offline Offline
7 posts
since May 2006
May 10th, 2006
0

Re: plz help(Airline Reservation System)

so is it correct up to now?

and how can i proceed?
Reputation Points: 10
Solved Threads: 0
Newbie Poster
wwaall2004 is offline Offline
7 posts
since May 2006
May 10th, 2006
0

Re: plz help(Airline Reservation System)

It seems to be going in the right direction.

You next step is to identify the functions which can be created, like addReservation(), showReservationDetails() and so on.
Reputation Points: 48
Solved Threads: 7
Posting Whiz
aniseed is offline Offline
353 posts
since Apr 2006
May 10th, 2006
0

Re: plz help(Airline Reservation System)

i really stuck,



i want you to explain to me in general what shall i do in the program

if u don`t mind

i really want to learn

and i will try to write the program by myself
Reputation Points: 10
Solved Threads: 0
Newbie Poster
wwaall2004 is offline Offline
7 posts
since May 2006
May 10th, 2006
0

Re: plz help(Airline Reservation System)

Well, the directions indicate you need to set up 5 arrays, so that might be one step you could take. This shouldn't be too hard, if you've been paying attention in class and doing the homework to date.

Then you could set up a display menu and declare a variable to hold user input which can then be used as the conditional of a switch statement to trigger calling functions needed to implement a variety of activities listed in then menu.
Reputation Points: 718
Solved Threads: 373
Nearly a Posting Maven
Lerner is offline Offline
2,253 posts
since Jul 2005
May 12th, 2006
0

Re: plz help(Airline Reservation System)

how about this at the beginning?

C++ Syntax (Toggle Plain Text)
  1. #include <stdio.h>
  2. #include<stdlib.h>
  3. #include<string.h>
  4. int x(char names[], char destination[], char info[], int number_seats[], int payment[]);
  5. void main (void)
  6. {
  7. int x , a , z, b, A, c;
  8. char names[50], destination[50], info[50];
  9. int number_seats[50], payment[10];
  10.  
  11. printf("Welcome to Airline Reservation System. \n");
  12. printf("******************************************************************\n");
  13. printf("\nplease enter the custumer name\n: ");
  14. scanf("%c",&names);
  15. printf("\nHow many seats do you want ?\n");
  16. scanf("%d",&number_seats);
  17. printf("\nWhere do you want to go?\n");
  18. scanf("%c",&destination);
  19. {
  20. printf("You must pay << 50 SR.>> for the reservations :\n");
  21. scanf("%d",&payment[50]);
  22. while ( payment[10]!=50 )
  23. {
  24. printf("\nPlease Enter << 50 SR >> ONLY ! Thank you:");
  25. scanf("%d",&payment[50]);
  26. }
  27. }
  28. }
Last edited by Dave Sinkula; May 12th, 2006 at 11:35 am.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
wwaall2004 is offline Offline
7 posts
since May 2006
May 12th, 2006
0

Re: plz help(Airline Reservation System)

I'd recommend backing up a little and first learning how to declare main, how to obtain strings, and how to obtain numbers. An array of size N may be indexed from 0 to N-1.
Team Colleague
Reputation Points: 2780
Solved Threads: 312
long time no c
Dave Sinkula is offline Offline
4,790 posts
since Apr 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: Need help in files
Next Thread in C++ Forum Timeline: parse error, syntax error, wtf error?





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC