Name: Worksheet 4: Conditionals CSCI 128 1. Consider the scenario: you are working at a movie theater's software division and are tasked to create a program which calculates the price of tickets depending on the age of the customers and size of the group. There are two different age groups: children (Under 16) and adults. Tickets for children cost $5 and adult tickets are $8. There are also discounts for different sizes of groups in brackets: Groups of 1-4 people get no discount, and groups of 5 and up get a 10 percent discount on their overall admission price. Write pseudocode for a program that calculates the ticket price given the person's age and group size.
Added by Frank E.
Close
Step 1
First, we need to get the age and group size from the user. So, we can start with: INPUT age, group_size Show more…
Show all steps
Your feedback will help us improve your experience
Manisha Sarker and 91 other Algebra educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
Explain a Python program to compute the price of a theater ticket. Your program should prompt the user for the patron's age and whether the movie is 3D. Children and seniors should receive a discounted price. There should be a surcharge for movies that are 3D. You should decide on the age cutoffs for children and seniors and the prices for the three different age groups. You should also decide on the amount of the surcharge for 3D movies. Your program should output the ticket price for the movie ticket based on the age entered and whether the movie is in 3D. Your program should include the pseudocode used for your design in the comments. Document the values you chose for the age cutoffs for children and seniors, the prices for the three different age groups, and the surcharge for 3D movies in your comments as well. Submit the Python program as a file (.py) file. In addition, you are also to submit a test report in a Word document or a .pdf file.
Akash M.
Python: Movie Ticket Write a Python function called "movie.py" that has no inputs and one output of the total cost. You will need to use input commands to get the number of movie tickets determine the movie ticket price based on a person's age. Set up a movie doc string with the information you had to enter in MATLAB. Movie Ticket prices: Persons 4 years old and under are free Persons older than 4 year old but less than 12 cost $7.50 Persons 12 years old and older cost $10 Enter the number of movie goers in each age group. Display: Enter the number of persons 4 years old and younger? 3 Enter the number of persons 5 to 11 year old? 4 Enter the number of persons 12 year old and older? 5 Persons Ages Cost/ticket Total Cost 3 4 years and younger Free $0.00 4 5 to 11 years old 7.50 $30.00 5 12 years old and older 10.00 $50.00 Total $80.00
DIRECTIONS: This assignment has two (2) parts. For each part create separate documents using Word or a text editor for the pseudocode solutions and separate documents using a drawing tool for the flowcharts. Name each file with the part it addresses. Hints for both parts:Use an array for department’s payroll. You can use the index of the array as the department’s number which is a parallel array to department payroll.The assignment will not know how many employees will be processed unknown size.Use a loop to capture and process all the employee data.As you handle the capturing the employee data, calculate the payroll for the employee and save it into the department array. Part 1:Design the logic for a company application that breaks down payroll by department. Input includes each employee’s last name, first name, department number, hourly salary, and number of hours worked. Output is a list of the seven departments in the company (numbered 1 through 7) and the total gross payroll for the department (sum of the rate x hours of all its employees) for each department.Example input should be as follows Wood, Anita, 4, 52, 40Example output should be as follows:1: 56482: 516883: 5469834: 8931665: 2346896: 1941367: 46813549Part 2:Modify Exercise 7a so that the report lists department names as well as numbers. The department names are shown in the table below.Example output should be as follows:Personnel, 1: 5648Marketing, 2: 51688Manufacturing, 3: 546983Computer Services, 4: 893166Sales, 5: 234689Accounting, 6: 194136Shipping, 7: 46813549 Department Department Number Name 1 Personnel 2 Marketing 3 Manufacturing 4 Computer Services 5 Sales 6 Accounting 7 Shipping
Recommended Textbooks
Elementary and Intermediate Algebra
Algebra and Trigonometry
Watch the video solution with this free unlock.
EMAIL
PASSWORD