Welcome to Dream.In.Code
Getting C++ Help is Easy!

Join 86,244 C++ Programmers. There are 2,254 online right now! Ask your question and get quick answers from Dream.In.Code experts. Join the #1 programming help community on the internet! Registration is fast and FREE... Join Now!

Chat LIVE With a C++ Expert
Powered by LivePerson.com

Register to Make This Box Go Away!

Theater Seating chart help

 
Reply to this topicStart new topic

Theater Seating chart help

mellow4lyf
post 8 May, 2008 - 03:36 PM
Post #1


New D.I.C Head

*
Joined: 8 May, 2008
Posts: 5



//Timm DeSalis
//Final Assignment
#include <iostream>
#include <iomanip>
#include <vector>
using namespace std;
int main()
{
//Row Prices
const int ROW_NUMBER = 5; //number of rows
vector<double> seatPrice(ROW_NUMBER); // vector of doubles
int index; //loop counter
//input seat prices
for ( index = 0; index < ROW_NUMBER; index++)
{
cout << "Please enter the price for row " << (index + 1) << ": ";
cin >> seatPrice[index];
cout << endl;
}

//seat chart
const char FULL = '*';
const char OPEN = '#';
const int r = 5;
const int c = 11;
char chart[5][11] = {OPEN};
cout << "The seats appear # empty and * if occupied:\n";
cout << "\t\tSeats\n";
cout << " 1 2 3 4 5 6 7 8 9 10\n";

for(int i = 0; i < 5; i++)
{
cout << "Row " << i;
for(int c2 = 0; c2 < 10; c2++)
{
cout << " " << OPEN;
}
cout <<endl;
}

//selcting seats and price of amount
int rowcount, seat, howMany;
cout << "Please select which row you would like to sit in: ";
cin >> rowcount;
cout << "Please select which seat in that row you would like to sit in: ";
cin >> seat;
//pricing
double cost;
cost = seatPrice[rowcount] * 1;
cout << "The price of that ticket is: " << cost << endl;





return 0;
}


Im lost right now the assignment is to have theater to sell tickets and keep track of them. the user enter the ticket prices then show the chart then ask the user the row then seat they want then mark the seat off and replace the # to a *. then must reshow the chart with the new seatin selection and be able to say if the seat is full or not when another seat is entered. any help will be appriated
User is offlineProfile CardPM
Go to the top of the page
+Quote Post


jjsaw5
post 8 May, 2008 - 05:15 PM
Post #2


D.I.C Addict

Group Icon
Joined: 4 Jan, 2008
Posts: 536

please use [code] tags when posting code...thanks
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

mellow4lyf
post 9 May, 2008 - 06:21 AM
Post #3


New D.I.C Head

*
Joined: 8 May, 2008
Posts: 5

Im sorry im new to this sight how do i do that? im just like really angry from trying to think of how to code this program.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

sno
post 9 May, 2008 - 05:43 PM
Post #4


New D.I.C Head

*
Joined: 4 May, 2008
Posts: 15

put [ code ] at the beginning of your code and [ /code ] at the end.

also what kind of problems are you having and where are you stuck?

This post has been edited by sno: 9 May, 2008 - 05:44 PM
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

mellow4lyf
post 10 May, 2008 - 02:22 PM
Post #5


New D.I.C Head

*
Joined: 8 May, 2008
Posts: 5

CODE
//Timm DeSalis
//Final Assignment
#include <iostream>
#include <iomanip>
#include <vector>
using namespace std;
int main()
{
//Row Prices
const int ROW_NUMBER = 5; //number of rows
vector<double> seatPrice(ROW_NUMBER); // vector of doubles
int index; //loop counter
//input seat prices
for ( index = 0; index < ROW_NUMBER; index++)
{
cout << "Please enter the price for row " << (index + 1) << ": ";
cin >> seatPrice[index];
cout << endl;
}

//seat chart
const char FULL = '*';
const char OPEN = '#';
const int r = 5;
const int c = 11;
char chart[5][11] = {OPEN};
cout << "The seats appear # empty and * if occupied:\n";
cout << "\t\tSeats\n";
cout << " 1 2 3 4 5 6 7 8 9 10\n";

for(int i = 0; i < 5; i++)
{
cout << "Row " << i;
for(int c2 = 0; c2 < 10; c2++)
{
cout << " " << OPEN;
}
cout <<endl;
}

//selcting seats and price of amount
int rowcount, seat, howMany;
cout << "Please select which row you would like to sit in: ";
cin >> rowcount;
cout << "Please select which seat in that row you would like to sit in: ";
cin >> seat;
//pricing
double cost;
cost = seatPrice[rowcount] * 1;
cout << "The price of that ticket is: " << cost << endl;





return 0;
}


im having trouble with how to price the ticket then have the seatin chart change to have the chart change so the seat become full then have it saved
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
Time is now: 5/16/08 08:28AM

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month