Question

For C# The manager of an event venue wants you to write a program that calculates...

For C#

The manager of an event venue wants you to write a program that calculates the total ticket sales after each event. There are four types of tickets:

  • orchestra ($100)
  • floor ($75)
  • tier 1 ($50)
  • tier 2 ($40)
  • tier 3 ($35)

The user should be asked for what level do they have tickets and how many. Please note: this program should only accept one type of ticket.

After each event, data is input by the user and then displayed in the following form for recording purposes:

Type of Ticket

Ticket Price

# of Tickets Sold

Cost

Orchestra

100

10

1000


Your program must have the following:

  • An introductory statement that allows the user to understand what type of program they are running.
  • Variable declarations
  • User input acceptance
  • Decision statement - that determines what the user entered and will give the price of the ticket.
  • Proper mathematical calculations
  • Proper output - so the user can see how much the total of the tickets cost.
  • You must provide the following:
    • Your code
    • Screenshot of your fully functioning program with inputs/outputs
0 0
Add a comment Improve this question Transcribed image text
Answer #1


/*
*You are running a C# console application, just double click on program.exe and follow the instructions
*/
using System;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
  

int[] ttype = {100,75,50,40,35};

while (true)
{
Console.WriteLine("Please Enter the ticket type [1-5]");
Console.WriteLine("1.orchestra \n2.floor\n3.tier1\n4.tier2\n5.tier3");
try
{
int type = Convert.ToInt32(Console.ReadLine());
if (type < 1 || type > 5)
{
//Validating user input
Console.WriteLine("Invalid input try again...\n");
continue;
}

Console.WriteLine("Please Enter the ticket Quantity");
int qty = Convert.ToInt32(Console.ReadLine());


//Calculating the total cost
int totalcost = type * qty;

string tickettype = "";

if (type == 1)
tickettype = "orchestra";
else if (type == 2)
tickettype = "floor";
else if (type == 3)
tickettype = "tier1";
else if (type == 4)
tickettype = "tier2";
else if (type == 5)
tickettype = "tier3";
Console.WriteLine("{0,10} {1,15} {2,15} {3,5}\n", "Type_of_Ticket", "Ticket_Price", "#_of_Tickets_Sold", "Cost");
Console.WriteLine("{0,10} {1,15} {2,15} {3,15}\n", tickettype, ttype[type - 1], qty, totalcost);
}
catch (Exception e)
{
// Try catch block is necessary in case user enters invalid input
Console.WriteLine(e.Message);

}
}

  
}
}
}

Input:

Output:

Add a comment
Know the answer?
Add Answer to:
For C# The manager of an event venue wants you to write a program that calculates...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • IN C# Write a program to help a local restaurant automate its lunch billing system. The...

    IN C# Write a program to help a local restaurant automate its lunch billing system. The program should do the following: Show the customer the different lunch items offered by the restaurant. Allow the customer to select more than one item from the menu. Calculate and print the bill. Assume that the restaurant offers the following lunch items (the price of each item is shown to the right of the item): Ham and Cheese Sandwich $5.00 Tuna Sandwich $6.00 Soup...

  • You have been asked to create a Dungeon and Dragons style game. They have asked you...

    You have been asked to create a Dungeon and Dragons style game. They have asked you to Design a class called Character that will hold the following information: Name Age Player’s Name Level Gender Race Class (i.e. fighter, wizard) Then create a program that will allow a user to add information into this class and then the program puts the information out. Just to demonstrate the functionality. Note - please keep this program for use later in the course. Your...

  • MATLAB HW 11 problem using Switch Case and Input commands Write a script file that calculates...

    MATLAB HW 11 problem using Switch Case and Input commands Write a script file that calculates the cost of a movie tickets according to the following price schedule:                                                  Number of Tickets being purchased Time of Movie < =5 tickets 6 to 9 tickets >=10 tickets Afternoon $6 $30 + $5 for the number of tickets above 5 $50 + $4 for the number of tickets above 9 Weeknight $7 $35 + $6 for the number of tickets above 5...

  • Please help me develop executable code in C++: //The manager of a football stadium wants you...

    Please help me develop executable code in C++: //The manager of a football stadium wants you to write a program that calculates the total ticket //sales after each game. There are four types of tickets sold: box, sideline, premium, //and general admission. //After each game, the data is stored in a file in the following form: //ticketPrice numberofTicketsSold //... //Sample data are shown below: //250 5750 //100 28000 // 50 35750 // 25 18750 //The first line indicates that the...

  • Write a C++ program that calculates the discount of the original price of an item and...

    Write a C++ program that calculates the discount of the original price of an item and displays the new price, and the total amount of savings. This program should have a separate header (discount.h), implementation (discount.cpp) and application files (main.cpp). The program must also have user input: the user must be prompted to enter data (the original price, and the percent off as a percentage). There must also be a validation, for example: Output: “Enter the original price of the...

  • Write a C program that calculates the percent saves for a soccer goalie for 4 games...

    Write a C program that calculates the percent saves for a soccer goalie for 4 games and the overall percentage of saves which is saves divided by the sum of goals plus saves * In this program I used 4 variables of type int, and 1 of type float, and 1 of type char (for the buffer clearing statement required). * This program requires an introductory statement to the user. * This program requires a loop structure (a for loop...

  • Part A) Write a C++ program that calculates the area under a curve. Here is the...

    Part A) Write a C++ program that calculates the area under a curve. Here is the equation: f(x) = x^2 +1.5x +4 You must prompt the user for the beginning and the ending x values. You are to assume, but not check, that the user will put in whole positive numbers. The units are inches. The program input/output should look something like this: This program calculates the area under a curve between two points on the x axis. The equation...

  • Write a program in C to assign seats of a movie theater (capacity: 200 seats). Your...

    Write a program in C to assign seats of a movie theater (capacity: 200 seats). Your program should display the following menu of alternatives: Please type 1 for "section A, $50/ticket" type 2 for "section B, $70/ticket", and type 3 for "section C, $80/ticket".  If the user types 1, then your program should assign a seat in the A section (seats 1–50). If the user types 2, then your program should assign a seat in the B section (seats 51–100). If...

  • USING PYTHON PLEASE Write a program that calculates the factorial value of a number entered by...

    USING PYTHON PLEASE Write a program that calculates the factorial value of a number entered by the user. Remember that x! =x* (x-1)* (x-2)*... *3+ 2* 1. Your program should check the value input by the user to ensure it is valid (i.e., that it is a number > =1). To do this, consider looking at the is digit() function available in Python. If the user enters an incorrect input, your program should continue to ask them to enter a...

  • read instructions carefully please matlab only Write a MATLAB function for a BMI calculator that receives the inputs for body weight (lbs)and height (ft) from the user's program, calculates th...

    read instructions carefully please matlab only Write a MATLAB function for a BMI calculator that receives the inputs for body weight (lbs)and height (ft) from the user's program, calculates the BMI using the equation below, displays the BMI category, and outputs the BMI value tothe user's program W (kg) h2 (m2) BMI Display Normal if 18.5 s BMI 25 Display Overweight if 25 s BMI <30 Display Obese if BMI 2 30 Else display underweight So you will create two...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT