Question

In: Computer Science

Problem #4 – Logical Operators: Movie Ticket Price The local movie theater in town has a...

Problem #4 – Logical Operators: Movie Ticket Price

The local movie theater in town has a ticket price of $12.00.

But, if you are a senior (55 and older), or are under 10, or are seeing a matinee which screens from 3 pm to 5 pm, you get the discounted price of $7.00, nice!

Hint 1: "55 and older" is INCLUSIVE

Hint 2: under 10 is EXCLUSIVE

Hint 3: the range 3 to 5 is INCLUSIVE

Hint 4: limit 1 per patron (i.e., it doesn’t compound)

Hint 5: considering there’s 3 am and pm and 5 am and pm, using a 24-hour clock (aka military time) may be an easier option (0000 to 2359)

Determine which of the two prices the customer is eligible for.

  • Givens:

    • Time of Movie (Assume whole numbers here)

    • Age of the customer

  • Result To Print Out:

    • "The ticket price is X"

Must use C# coding using conditional statements

Solutions

Expert Solution

Code-

using System;

class MainClass

{

static public void Main(string[] args)

{

int age,time;

Console.Write("Enter your age");

age=int.Parse(Console.ReadLine());//reading int input

Console.Write("Enter the time");

time=int.Parse(Console.ReadLine());//reading int input

if(age>=55 || age<10 || (time>=1500 && time<=1700))//Or,and operations used accordingly

Console.Write("The ticket price is $"+7);

else

Console.Write("The ticket price is $"+12);

}

}

Indenatation-

Output-


Related Solutions

XYZ operates a movie theater. A movie ticket is $16.00 per ticket, and costs nothing
  XYZ operates a movie theater. A movie ticket is $16.00 per ticket, and costs nothing. On average 40% of the customers will buy a soda ($6 each, cost $1); 60% will buy food ($6 average price with a cost of $2). The fixed costs are $387,600. Calculate the break-even quantity and $sales for tickets, soda and food(10 points)   The theater wishes to make $96,900 profit. Calculate the target profit quantity and sales for tickets, soda and popcorn (10 points)...
A movie theater has at most 90 seats available. Each adult movie ticket costs $14, and...
A movie theater has at most 90 seats available. Each adult movie ticket costs $14, and each child movie ticket costs $8. To make a profit, the theater must bring in more than $852 in ticket sales per show. A) In terms of A and C, write an inequality that represents the restriction on total occupancy. B) In terms of A and C, write an inequality that represents the restriction on total ticket sales. C) Make a graph that represents...
4. Derek is the owner of the only movie theater in town. By hiring several well-trained...
4. Derek is the owner of the only movie theater in town. By hiring several well-trained economists, Derek learns that the people watching movies after 8 P.M. have a much higher average willingness to pay than people watching at 5 P.M. The costs of showing a movie are identical at 5 P.M. and 8 P.M. To maximize his profit, what should Derek do? Give him some specific advice, including drawing him a diagram or two. (Derek can get his economists...
To conduct an experiment, a movie theater increased movie ticket prices from $9 to $10 and...
To conduct an experiment, a movie theater increased movie ticket prices from $9 to $10 and measured the change in ticket sales. The theater then gathered data over the following month to determine whether the price increase was profitable. Assume total costs to the theater are the same, whether the price of a ticket is $9 or $10. In order for the ticket price to have been profitable over the month, the elasticity of demand for movie tickets must be...
You’ve been assigned to set the price at the local movie theater. You know that market...
You’ve been assigned to set the price at the local movie theater. You know that market demand can be broken into two groups, students and non-students. Those functions are: Students: p = 12 − 1/4q Non-Students: p = 22 − q (if you aggregated those functions, you would obtain p = 22 − q if p > 12 and p = 14 −1/5q if p ≤ 12). You’ve also been given the total cost and marginal cost for the theater....
The local movie theater industry has a demand curve of P=26-.2Q for a movie showing (please...
The local movie theater industry has a demand curve of P=26-.2Q for a movie showing (please note the decimal in front of the 2). It has a supply curve (MC curve) of $2, because the theater figures for each customer there will be a cleanup cost afterwards. In reality, a theater might sell food and drinks for extra profits, but this one does not. What is allocative efficiency? What is the price of a ticket and number of patrons (quantity)...
The local movie theater industry has a demand curve of P=26-.2Q for a movie showing (please...
The local movie theater industry has a demand curve of P=26-.2Q for a movie showing (please note the decimal in front of the 2). It has a supply curve (MC curve) of $2, because the theater figures for each customer there will be a cleanup cost afterwards. In reality, a theater might sell food and drinks for extra profits, but this one does not. What is allocative efficiency? What is the price of a ticket and number of patrons (quantity)...
Use logical operators in descriptions of rules and relationships in a problem situation.
Use logical operators in descriptions of rules and relationships in a problem situation.
In Python Suppose there is a movie theater who charges ticket based on ages. Less than...
In Python Suppose there is a movie theater who charges ticket based on ages. Less than 3 years old, free; between 3 to 12, $10; more than 12 years old, $15. Please design a program with loop to, 1) Ask the name then age of the audience, 2) Based on audience's input, tell the audience (with the person's name) how much is the ticket, 3) Stop the program when type in 'quit' in your program.
Consider the movie ticket and popcorn example discussed in Section 17.7. The theater sells two products,...
Consider the movie ticket and popcorn example discussed in Section 17.7. The theater sells two products, tickets and popcorn. Suppose the weekly demand for movie tickets is           Qdtix=500−25Ptix−20Ppopcorn, where Ptix and Ppopcorn are the prices of a ticket and a bag of popcorn, respectively. Suppose that each time a moviegoer buys a ticket, his demand for popcorn is           Qdpopcorn=3−0.4Ppopcorn, where Qdpopcorn is the number of bags of popcorn the moviegoer buys. Suppose further that the theater's...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT