I'm doing a program that shows which tickets have been sold for an auditorium. I am a beginner to c++ so I am not sure how I can do the following:
a) Allocate an input with a character (e.g. when I enter 'A10' .. how do I allocate 'A' to an integer input?)
b) How to show, on a 2-D array, when a spot has been sold (e.g. if I enter 'A10', how do I erase that spot off the board?)
I've read lots of tutorials but it's just those 2 things that I am unclear on.
Here is my current program. It's basically static at the moment:
#include<iostream>
#include<iomanip>
#include<string>
using namespace::std;
int aud[19][24];
char change;
double Total_Sales;
char database[20][20];
int output()
{
char Letter;
int database;
for(int x=0;x<=24;x++)
{
for(int y=0;y<=19;y++)
cout<<" x";
cout<<endl;
}
for(int Outer_Loop = 0;Outer_Loop<=25;Outer_Loop++)
{
for(int Seats_Letter_Display = 1;Seats_Letter_Display <=1;Seats_Letter_Display++)
{
switch(Letter)
{
case 1:cout<<" A"; break;
case 2:cout<<" B"; break;
case 3:cout<<" C"; break;
case 4:cout<<" D"; break;
case 5:cout<<" E"; break;
case 6:cout<<" F"; break;
case 7:cout<<" G"; break;
case 8:cout<<" H"; break;
case 9:cout<<" I"; break;
case 10:cout<<" J"; break;
case 11:cout<<" K"; break;
case 12:cout<<" L"; break;
case 13:cout<<" M"; break;
case 14:cout<<" N"; break;
case 15:cout<<" O"; break;
case 16:cout<<" P"; break;
case 17:cout<<" Q"; break;
case 18:cout<<" R"; break;
case 19:cout<<" S"; break;
case 20:cout<<" T"; break;
}
Letter++;
}
}
}
int main()
{
float AE,FK,LT;
float AE_sold,FK_sold,LT_sold;
int row;
char column;
double S1 = 12.00;
double S2 = 8.50;
double S3 = 6.50;
output();
cout<<"\nCurrent Prices: ";
cout<<S1;
cout<<S2;
cout<<S3;
cout <<"\n\nEnter the price for A-E: $";
cin >> AE;
cout << "";
cout <<"Enter the price for F-K: $";
cin >> FK;
cout << "";
cout <<"Enter the price for L-T: $";
cin>>LT;
cout<<"";
cout<<"\n\nSelect a column letter: ";
cin>>column;
cout<<"Select a row number: ";
cin>>row;
system("PAUSE");
return 0;
}