i m in trouble ladies and gentlemen agent help needed
is that you have same prob with me ?
i m in trouble ladies and gentlemen agent help needed
is that you have same prob with me ?
Here's a basic code; that's using two bool arrays to determinate if the seat is taken and if the seat is for smokers;
#include <iostream> using namespace std; #define Row 2 #define Column 10 bool SeatTaken [Row][Column]; // Is a specific seat taken? bool SmokerSeat[Row][Column]; // Is a specific seat for smokers? void ClearSeatsTaken() { for (int n=0; n<Column; n++) for (int a=0; a<Row; a++) SeatTaken [a][n]=0; } void SetSmokerSeats() { for (int n=0; n<Column; n++) {for (int a=0; a<Row; a++) {SmokerSeat [a][n]=0;}} for (int n=0; n<Column/2; n++) {for (int a=0; a<Row; a++) {SmokerSeat [a][n]=1;}} } void TESTUNIT() { for (int n=0; n<Column; n++) {for (int a=0; a<Row; a++) {cout << SeatTaken [a][n] << " ";} cout << endl; } } void MISSING() { cout << "THIS PART OF THE PROGRAM IS MISSING; IT*S NOT MADE YET. IT SHOULD FIND ANOTHER RUTE IN THIS FUNCTION!" << endl; } void DedicateSeat(bool Smoker) { bool GlobalBreak=false; for (int n=0; n<Column; n++) { if (GlobalBreak==true){break;} for (int a=0; a<Row; a++) { if (GlobalBreak==true){break;} if ((SmokerSeat [a][n]==Smoker) && (SeatTaken [a][n]==false)) { SeatTaken [a][n]=true; cout << "Seat" << a << " at " << n << " is now taken!" << endl; GlobalBreak=true; } } } if (GlobalBreak==false) { bool Interrested=false; cout << "ERROR! No "; if (Smoker){cout << "smoker";}else{cout << "non smoker";} cout << " seats avaiable!" << endl; cout << "Interrested in another apparture? [Yes=1][No=0]" << endl; cin >> Interrested; if (Interrested){MISSING();} } } bool YouASmoker() { int SmokerSeatNeeded=0; cout << "Do you …
#include <iostream>
#include <string>
using namespace std;
void initialize(int& flight, int& seatAreaOne, int& seatAreaTwo);
void plane(int flight);
void planeOne(int seatAreaOne);
void planeTwo(int seatAreaTwo);
int main()
{
string name;
string passport;
int flight;
int seatAreaOne;
int seatAreaTwo;
int seat[10]={1,2,3,4,5,6,7,8,9,10};
cout<<"WELCOME TO C++ AIRLINES."<<endl;
cout<<"Please enter your name:"<<endl;
getline(cin, name);
cout<<"Please enter your passport number:"<<endl;
cin>>passport;
cout<<"Name:"<<name<<endl;
cout<<"Passport number:"<<passport<<endl;
initialize(flight, seatAreaOne, seatAreaTwo);
plane(flight);
cout<<"your seat number is "<<seatnum<<endl;
return main();
}
void initialize(int& flight, int& seatAreaOne, int& seatAreaTwo)
{
flight = 0;
seatAreaOne = 0;
seatAreaTwo = 0;
}
void plane(int flight)
{
int seatAreaOne;
int seatAreaTwo;
seatAreaOne = 0;
seatAreaTwo = 0;
cout<<"For your information, our company provides only two flights per day."<<endl;
cout<<"Enter (1) for flight A101 OR (2) for flight A102."<<endl;
cin>>flight;
if (flight==1)
{
cout<<"A101"<<endl;
planeOne(seatAreaOne);
for(seatnum=1,seatnum<6,seatnum++)
seat[seatnum]=seatnum;
}
else
{
cout<<"A102"<<endl;
planeTwo(seatAreaTwo);
for(seatnum=6,seatnum<11,seatnum++)
seat[seatnum]=seatnum
}
}
void planeOne(int seatAreaOne)
{
int seatArea;
cout<<"There are two types of seating area provided in this flight:"<<endl;
cout<<"Please choose a type of seating area."<<endl;
cout<<"Enter (1) for smoking area seat OR (2) for non-smoking area seat."<<endl;
cin>>seatArea;
if (seatArea == 1)
{
cout<<"Smoking area"<<endl;
}
else
{
cout<<"Non-smoking area"<<endl;
}
}
void planeTwo(int seatAreaTwo)
{
int seatArea;
cout<<"There are two types of seating area provided in this flight"<<endl;
cout<<"Please choose a type of seating area."<<endl;
cout<<"Enter (1) for smoking area seat OR (2) for non-smoking area seat."<<endl;
cin>>seatArea;
if (seatArea == 1)
{
cout<<"Smoking area"<<endl;
}
else
{
cout<<"Non-smoking area"<<endl;
}
}
i ony able do until tis step …
your problem analysis seems not like ur question. ur question is very simple..
u no need to name, ic no etc..
just the smoke n non smoke..
understand ur question first pls
u can do like the problem analysis that u made, but its take timemake ur code first, then i'll check
but ur draft using if else is correct..u also can do it with array# int seats[ 11 ]; // if you want to start counting from 1 # int smoking = 1; // where the seats for the Smoking-Category start # int nonsmoking = 6; // where the seats for the Non-Smoking Category start // initialize the seats[] to all zero if it is not already # // If user wants the Smoking Category # // If there are more available seats for the smoking category # (in which bounds should the smoking variable be?) # // Notify the user about the reservation (user fprintf()) # // Update the seats[] array (assign 1 to the taken seat) # // Else (no more seats) # // Notify the user that no more seats are available (use fprintf()) # // Use your own strategy here... you can ask user if he wants a seat # // in the Non-Smoking Category # // EndIf # // Else (the user wants the Non-Smoking Category) # // The same as above (except you use the nonsmoking variable instead # // of the smoking variable # // …
i know how to do this..
but u must first attach ur work..
this is basic actually..
oh , i see.. that why my post is no ppl answer so long time ...
Assumption: The user already choose the airplane location, which is the destination from A to B ,which is provide by the Airline Company .
Problem Analysis
• The purpose of the program is to allocate each seats for passengers for each flight on the certain date according the schedules provide by the Airline Company.
• For each airplane, it have capacity with ten seats. It divides to two type of seat , which is smoking area for seat 1 to 5, and non-smoking area which is 6 to 10.
• So, we need to design an algorithm to allocate the available seat for customer. If the type of seat which customer required is fully booked , we will give what kind of alternative solution .
Input/Output
The program will prompt user to input:
• Type of seat (smoking or non-smoking)
• User Detail
Name
IC number
Passport number
Date of Birth
Email
Phone
Gender
Occupation
Nationality
• Address Detail
Address
City
Postal Code
State
Country
Output :
• Online Booking Reference
• Name
…
You've received an impossible assignment.
why you say is impossible , can tell me more ,please ?
Thank a lot ...
hello All,
i have no idea where should i post this question ...
This is my Operating system assingnment . Can any one give me some example ?
"In academic literature or the Internet, research the use of graphics to replace typed passwords.
Describe the historical milestones of the technology and the advantages and disadvantages of the
technology. Finally find one real world applications that use this technology, citing your sources "
Thank you ..
Grace be with you ...
xy
Hello,
i already have C++ class few month , but i still find difficult to write the problem analysis on this project ...
This is my question ...
"Problem Specification
A small scale Airline Company bought a new computer to computerize their airline ticket booking system. The company’s CEO asked to program the new system in C++ language.
Your job is to write a program to allocate seats for passengers for each flight. The company only has an airplane with capacity of ten seats. Your program should display an alternative menu below:
Please type 1 for “smoking”
Please type 2 for “nonsmoking”
If a passenger chooses 1, your program should allocate seat in smoking area that is from seat 1 – 5.
On the other hand if the passenger chooses 2, give them seats in the nonsmoking area that is from seat 6 – 10.
Your program should also print a boarding pass for the passenger showing their seat number and indicating their selection of smoking/ nonsmoking area.
Your program cannot allocate a seat that has been booked by other passenger. And when the smoking area is fully booked, the passenger should be given an option to book a seat in the nonsmoking area and vise versa. If the passenger agrees with the option given, allocate them a seat; otherwise inform them the next flight schedule. "
our lecturer is asking us to submit Problem Analysis …