I am new to C++ and need help with this output after the debugging....

Type of Ticket
Orchestra
Mezzanine
Balcony

Select:
Number of Adults:
Number of Children:

This is what it is supposed to look like and I am confused on multiple issues. All i know is need to use constants. Also under the type of ticket such as orchestra, etc how do I move the three options into more of a tab...finally I need to know how to compute all this in?

Jim Johnson

Recommended Answers

All 8 Replies

ok I got the spacing part figured out but from there I'm gonna show everyone my code just to show you guys I am not just lookin for easy answers....

// Assignment: P01
// Date: 01/17/2008
#include <iostream>
#include <string>
using namespace std;

int main ()
{
	string first_name, last_name;
	char type1, type2, type3;


	cout << "Programmed By: Bryan Kruep \n";

	cout << endl << "First and Last Name: ";
	cin >> first_name;
	cin >> last_name;

	cout <<  "Type of Ticket ";
			cout << endl << "        O - Orchestra ";
			cout << endl << "        M - Mezzanine ";
			cout << endl << "        B - Balcony ";

			cout << endl << "Select: \n";

			


		return 0;
} // end of main

>>All i know is need to use constants.
You have failed to tell us what the program is supposed to do so how can we help you ?

>>Also under the type of ticket such as orchestra, etc how do I move the three options into more of a tab
That does that mean? Looks like the code you posted should be ok.

>>finally I need to know how to compute all this in
Again, we are not mind readers and have no idea what you are talking about.

Here is all the information I have and nevermind about the orchestra I figured that part out...

Objectives: assignment statements, if statements

Problem Description
In this programming assignment you are to write a program to determine how much tickets will cost at the theater. The cost of a ticket depends on the type of ticket bought.

Orchestra Seats - $72.50
Mezzanine Seats - $45.25
Balcony Seats - $31.75

Children receive a 12.5% discount off of the adult price.
The tax on ticket is 11.25%.

The numbers that are underlined should be declared as constants. The computer should do ALL calculations using these numbers. (In other words, do not compute the child’s cost and then literally type it into your program. The program should compute the child’s cost.)

Program Requirements
 Do not hand in a program that does not compile or it crashes. It will receive a 0.
 Please note that late assignments will not be accepted and will receive a 0.
 Include the following program header comments
// Name: <Your Name>
// Class: CS140-001
// Assignment: P01
// Date: <the date>

 Your program should have FIVE constants (they are the numbers underlined in the description)
 Make sure your program can produce the same output as shown in the screenshots.
 The spacing on your output should be identical to those shown in the screenshots.

Start at the top and to the assignment one requirement at a time. For instance, you need to define constants the the prices of all those tickets.

Next you need to add the required comments. The code you posted failed to do that correctly.

You will probably have to declare int variables for the number of each kind of tickets and whether they are adult of childrens tickets.

can anyone help me that isnt a ****

can anyone help me that isnt a ****

Oh?? what you really mean is "will someone write this because I'm too lazy or dumb to do it myself".

He's not really being a dick. He's just telling you plainly what you did incorrectly.

You probably want to add the comments first.
all you need is the // in front of the text you want to be a comment, meaning that it will not be interpreted by the compiler as code.

constants are typically declared by using
CONST (name)

so you may want to say:
CONST float OrchestraSeats = 72.50
CONST float MezzanineSeats = 45.25
CONST float BalconySeats = 31.75

then you need to ask the user what type of seats he has, how many he has, if any are children's seats ect... these values need to be placed in int variables.

Depending on the response, an if statement will be used to output the resulting cost.

try some of this out. Any of this can be easily found using google. I you have learned if statements, you didn't start programing yesterday. Put some effort in, then come back. Do the parts that you know how to do. Ignore the others.

Hallo I can help you if u can write your question correctly. There is one requirement that ....Make sure your program can produce the same output as shown in the screenshots.....

Where are screenshots here. Please post total question..so i can help you to write program for that..

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.