|
| Computing.Net: Over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to sign up now, it's free! |
Urgent: need help with c++ coding
|
Original Message
|
Name: Kevin_
Date: February 10, 2003 at 22:53:30 Pacific
Subject: Urgent: need help with c++ coding OS: WIN 98 CPU/Ram: 1.8GHZ, 128
|
Comment: CAN ANYONE PLEASE WRITE THE CODING FOR THIS PROBLEM. I WOULD GRATELY APPRECIATE IF SOMEONE COULD HELP ME OUT. I NEED THIS CODING(WHICH WORKS ON BORLAND C++5.0 OR 6.0) BY THURSDAY MORNING. HERE IS THE CASE AND I NEED THE COMPLETE WORKING SOURCE CODE. I HAVE NO IDEA ABOUT CODING AND CANNOT HENCE CANNOT DEBUG. PLEASE HELP ME A small airline has just purchased a computer for its new automated reservations system. You have been asked to program the new system. You are to write a program to assign seats on each flight of the airline’s only plane (capacity: 10 seats). Your program should display the following menu of alternatives: Please type 1 for “First Class”, Please type 2 for “Economy Class”. If the person types 1, your program should assign a seat in the first-class section (seats 1-5). If the person types 2, your program should assign a seat in the economy section (seats 6-10). Your program should print a boarding pass(on the screen itself), indicating the date of flight (which should be the current system date), person’s seat number and whether it is in the first-class or economy section of the plane. The format of the date should be as follows : , (for example, January, 30, 2003) Use an array to represent the seating chart of the plane. The value 0 indicates that the seat is empty. The value 1 indicates that the seat is assigned or no longer available. The program should take care that, if a seat has already been assigned, it cannot be used to assign to another person. When the first class section is full, your program should ask the person if it is acceptable to be placed in the economy section (and vice versa). If yes, then make the appropriate seat assignment. If no, then print the message “Next flight leaves in 4 hours.” Use appropriate comment entries to signify your course code, student ID, last name and first name. Adherence to good programming techniques like indentation and validations is required.
Report Offensive Message For Removal
|
|
Response Number 2
|
Name: Kevin_
Date: February 11, 2003 at 08:58:48 Pacific
|
Reply: (edit)I know Fuzaketoru, it will take a long time to do it by myself and the deadline is this thursday. I just need help only this time. I know there are great people out there who can write the code for this in minutes. Guys just help me out!
Report Offensive Follow Up For Removal
|
|
Response Number 3
|
Name: wiseguy
Date: February 12, 2003 at 11:22:53 Pacific
|
Reply: (edit)You said.. I HAVE NO IDEA ABOUT CODING AND CANNOT HENCE CANNOT DEBUG. PLEASE HELP ME If you have "no idea" about coding, why are you in a programming class? And you cannot debug until you actually write code. I have no trouble helping people with their homework, but "helping" does not include "doing". You have made absolutely no effort to attempt this on your own and having someone hand you the source code isn't going to help you one bit. If your teacher is worth anything, he'll recognize that it is not your work. I admit, I was very tempted to do this for you and use some higher level concepts so your instructor would know it wasn't your work. But I'm afraid you have a sub par teacher who wouldn't even look. Go try to write the program and bring some source code back and I'll gladly help you, but you have to at least try to do it on your own. jeff
Report Offensive Follow Up For Removal
|
|
Response Number 4
|
Name: Kevin_
Date: February 12, 2003 at 19:01:16 Pacific
|
Reply: (edit)Thanks for your advice Jeff. I respect that. I will try to figure out atleast something.I will try upto my ability.
Report Offensive Follow Up For Removal
|
|
Response Number 5
|
Name: Kevin_
Date: February 12, 2003 at 23:49:19 Pacific
|
Reply: (edit)Hi Jeff, Here is what I have got,it needs some fix. My idea might be wrong. The printing of boarding pass and message saying that the "Next flight leaves in 4 hours" is not done. Could you fix it please asap. Thanks. #include int main() { int seat [10] = {NULL} int firstclass = 0; int economyclass = 5; char Choice; int i = 0; int num; cout > Choice; if (Choice= = 1) switch (Choice) { case 1: cout "Your choice is 1."; break; case 2: cout "Your choice is 2."; break; default: cout "Your choice is incorrect. Either choose 1 or 2 and try again." endl; } for ( i =0; i 5; i++) { cout "Your assigned seat is: \t" i endl; firstclass++; if (seat [4] = 1) cout endl; cout "This section is full. Would you like to be assigned to"; cout " the economyclass section?" endl; cout endl; } for (i = 5; i 9; i ++) { cout endl; cout " Your assigned seat is:\t" i endl; economyclass++; if (seat [9] = 1) cout endl; cout "This section is full. Would you like to be assigned to"; cout "the firstclass section?" endl; } return 0;
Report Offensive Follow Up For Removal
|
|
Response Number 6
|
Name: wiseguy
Date: February 13, 2003 at 07:28:47 Pacific
|
Reply: (edit)For the "next flight..." message, you need to capture the response after the "This section is full..." message using cin >> variable. then... if (variable == 1) //yes //assign them to economy / first class else //they didn't want to switch cout "The next flight leaves in 4 hours" endl;
Report Offensive Follow Up For Removal
|
|
Response Number 7
|
Name: Kevin
Date: February 13, 2003 at 08:51:46 Pacific
|
Reply: (edit)Wise guy, did u find any errors in this coding? When I trie to comile it showed me 20 errors and I couldnt fix it. Can someone please...
Report Offensive Follow Up For Removal
|

Post Locked
This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
Go to Programming Forum Home
|
|
|