[SOLO] Write a program that uses a two-dimensional array to store the highest and lowest temperatures for each month of the year. The program should output the average high, average low, and the highest and lowest temperatures for the year. Your program must consist of the following functions:
a.
b.
FunctionaverageHigh:Thisfunctioncalculatesandreturnstheaveragehightemperaturefortheyear.
c.
FunctionaverageHigh:Thisfunctioncalculatesandreturnstheaveragelowtemperaturefortheyear.
d. FunctionindexHighTemp:Thisfunctionreturnstheindexofthehighesthightemperatureinthearray.
e.
FunctionindexLowTemp:thisfunctionreturnstheindexofthelowestlowtemperatureinthearray.(These functions must all have the appropriate parameters.)

Here are some quotes from the rulebook:

Do not post homework problems expecting a quick answer without showing any effort yourself. This especially pertains to the software development forums. For easy readability, always …

> but i dont know any part of it.....
The point of homework is for you to learn as you do it. You're not supposed to understand everything completely and be able to write it all without any effort. :icon_rolleyes: In fact, Edward would say that figuring things out on …

i dont know how to make array on a function...
.

I'll give you a small start:

``````int main()
{
const int rows = 13, seats = 6;
char plane[rows][seats]; // make a 2d array for all the seats

for (int k = 0 ; k<rows; k++) …``````

i dont know how to make array on a function...

## All 15 Replies

[SOLO] (Airplane Seating Assignment) Write a program that can be used to assign seats for a commercial airplane. The airplane has 13 rows, with 6 seats in each row. Rows 1 and 2 are first class; the remaining rows are economy class. Also, rows 1 through 7 are nonsmoking. Your program must prompt the user to enter the following information: a. Tickettype(firstclassoreconomyclass)b. Foreconomyclass,thesmokingornonsmokingsectionc. DesiredseatOutput the seating plan in the following form:
ABCDEF
Row1 **X*XX
Row2 *X*X*X
Row3 **XX*X
Row4 X*X*XX
Row5 *X*X**
Row6 *X***X
Row7 X***XX
Row8 *X*XX*
Row9 X*XX*X
Row10 *X*XXX
Row11 **X*X*
Row12 **XX*X
Row13 ****X*

Here, * indicates that the seat is available; X indicates that the seat is occupied. Make this a menu-driven program; show the user’s choices and allow the user to make the appropriate choices. –––––––– Nothing Follows ––––––––

Here are some quotes from the rulebook:

Do not post homework problems expecting a quick answer without showing any effort yourself. This especially pertains to the software development forums. For easy readability, always wrap programming code within posts in code blocks and inline code tags.

And :

Do not post threads with generic subjects such as "HELP ME" or "PROBLEM". Instead, clearly state a phrase describing the problem as the thread's title. Do not flood the forum by posting the same question more than once (ie in multiple forums).

So you've broken quite a lot of the rules with your posts...

Anyhoo: What have you tried so far? You're not going to get free homework, so you'll have to show that you made an effort to solve this problem yourself.

but i dont know any part of it.....

im juct a begginer and that problem is given to me... please, just a part of it will help me

> but i dont know any part of it.....
The point of homework is for you to learn as you do it. You're not supposed to understand everything completely and be able to write it all without any effort. :icon_rolleyes: In fact, Edward would say that figuring things out on your own is the key to really learning how to do something.

i dont know how to make array on a function...

i promise i will make it..

if only i know what to do first,....

i dont know how to make array on a function...
.

I'll give you a small start:

``````int main()
{
const int rows = 13, seats = 6;
char plane[rows][seats]; // make a 2d array for all the seats

for (int k = 0 ; k<rows; k++) // loop through the rows
for (int l = 0; l<seats; l++)// in each row loop through the seats
plane[k][l] = '*';       // set all the values standard to '*'
}``````

This code creates a 2d-array and fills it with stars. Now what you need to do is make a menu so that the user can input what kind of seat (s)he wants.
If you have any questions about the code, (I guess you will) just ask.

i dont know how to make array on a function...

What ?!, did you read neik_e's post.. :angry:
Nobody's going to do your work for you..

What ?!, did you read neik_e's post.. :angry:
Nobody's going to do your work for you..

You're right, although you got my name wrong ;)

thnk you mr.... that is i find it rellly hard using 2d array....

i will send to you what i s my progress on that ticket program....

tnx mr....

sniper.... hm, i hope you're not really a sniper, because, well... i guess i'd just be sad a little bit... uh, never mind.

hahaha ok i'm sori....

now i know i little bit about array ...

i'm just a newbie...

i dont know why it is on my syllabus ...

i am taking up electrical engineering and yet i have c++

well... thats ok atleast..

tnx niek_e

really, man, if you're going to be an electrical engineer someday, you need to learn how to approach problems methodically without all the whining and crying.

:icon_rolleyes:

seriously. Arrays -- 2-D and otherwise -- are freshman material. theres a concept you should become familiar with, it's called: Look It Up

.

``````#include<iostream.h>
#include<conio.h>
int userInput(int);
int main()
{clrscr();
int x,y;
int a;
const int row= 12,seat= 5;
char plane[row][seat];
cout<<"A\tB\tC\tD\tE\tF"<<endl;
{for (y=0;y<=12;y++)
{for(x=0;x<=5;x++)
{ plane[y][x]='*';
cout<<plane[y][x]<<"\t";
}
cout<<endl;
}
}
userInput(a);
getch();
return 0;
}
``````

where will i put ROW so that it has label on the y-axis????