473,394 Members | 1,715 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

I hope you don't tick off any Mods by making them edit each individual post you make

I am asked to

Write a program to assign passengers seats in an airplane. Assume a small airplane with seat numbering as follows:

1 A B C D
2 A B C D
3 A B C D
4 A B C D
5 A B C D
6 A B C D
7 A B C D

Am I going in the right direction? I need to use 4 arrays

//seating
# include<iostream>
using namespace std;
int main ()
{

Char row[7];
seat [1]=ABCD
seat [2]=ABCD
seat [3]=ABCD
seat [4]=ABCD
seat [5]=ABCD
seat [6]=ABCD
seat [7]=ABCD
???
Nov 29 '07 #1
3 1319
oler1s
671 Expert 512MB
Are you just arbitrarily guessing? Try thinking for more than 2 seconds. You declare an array of char 7, and then refer to seat. It's not compileable code anyway. Why 7 chars? I see 7 rows of A, B, C, and D. Why does it need to be a char? You're assigning passengers, not chars.
Nov 29 '07 #2
weaknessforcats
9,208 Expert Mod 8TB
I don't see the airplane. All I see are the seats. Where's the airplane??
Nov 29 '07 #3
Studlyami
464 Expert 256MB
write out the logic of the program first without thinking about code. Work out the logic and flow of the problem then try and convert it. EX: for each row there are X amount of seats. Assigned to each seat is a passenger, before i assign a passenger to the seat is it already taken, ect.
Nov 29 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Frank Wallace | last post by:
thanks for replying to my post..i did not think anybody would reply...i am only 13 and English is not my first language but i will try to describe what i am trying to do... well iam trying to...
0
by: Jony Joe | last post by:
Dear All; I am now making a deployment package using the .net deployment setup project. It is a desktop application that its solution contains 7 projects that generate DLLs and EXEs...
7
by: dj Bass | last post by:
simple, they don't like things that restrict the server-side controls... and when it comes to frames, you need client side stuff and that stuff's up the asp.net strategy. right or wrong?
8
by: pmud | last post by:
Hi, I have 2 questions: 1. I have an editable data grid with 21 columns. I need to edit only 2 cloumns in this data grid. But when the grid is displayed in Edit mode, all the columns show long...
10
by: Martin Eyles | last post by:
Hi, I want to make a scale on a graph, by telling asp to insert empty divs of class tick, and the setting the style in css. I am trying to get a 3D effect by using colored top and bottom borders...
0
by: Mike Cox | last post by:
Hi. As most of you know, comp.databases.postgresql.general is a wonderful resource. What you may not know is that it has not gone through a process that would enable it to be listed on hundreds...
5
by: John | last post by:
Hi I have a bound gridview. I need to allow users to select multiple rows and then press the process button to process multiple selected rows. For this I want to use additional column of...
5
by: not_a_commie | last post by:
So I have a motherboard with multiple CPU sockets. It seems that if I create a StopWatch on one thread and then call the Elapsed member from a different thread that sometimes I get a tick count...
5
by: Andy B | last post by:
I have 2 TextBoxes and an Add button on a page. When the user fills in the TextBoxes, the values are added to a dataset table. When the page gets done reloading, the TextBoxes are turned into...
1
by: Jahamos | last post by:
Background: I have copy and pasted an Excel flowchart into a Dreamweaver html page. I created a frame on the top of the page as a viewer. I created hotspot links over the flowchart items. Each...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.