i am supposed to write a program that will assign seats on a ten seat plane. dont worry, im not asking you to write code for me im getting a little better at this but my teacher still sucks... so here is what i have.
btw. the program asks the person to pick a number , ( 1 for first class and 2 for seoncd.) im supposed to use arrays.... so..this is what i have but it doesnt work well... any help would be appreciated emensly.
Code:
#include <iostream>
using std::cout;
using std::cin;
using std::endl;
int main ()
{
int arrayf[5];
int arrays[5];
int num;
int i = 0;
cout<< "Pick a class, 1 for first and 2 for second.";
cin>>num;
if (num== 1)
for (int i = 0;i <=arrayf[5];i++)
cout<<" Your seat is in " <<num<<"st Class, and your seat number is "<<arrayf[i]<<endl;
return 0;
}
when i compile this it runs forever, so i couldnt get the second class done... please help!!!
Code tags added by Hammer