Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

* * CODE IN C * * Your program calculates and prints the total charge for a selected package, the duration, and food ( based

**CODE IN C**Your program calculates and prints the total charge for a selected package, the duration, and food (based on the number of people attending).
\table[[Package,\table[[First Hour],[for the],[event],[(minimum)]],\table[[Hourly],[Cost],[after],[the],[First],[Hour]],\table[[Minimum],[number],[of guests]],\table[[Maximum],[number],[of guests]],\table[[Cost],[per],[person],[for],[food]],{ff559fd5f-d67d-4e23-84ca-93749a8abff2}
\table[[Maxir],[charg],[(incluc],[food)],[an eve]]],[1,$150,$100,5,20,$25,$595An event venue offers four packages for parties (birthday parties, graduation parties, retirement parties, etc.). It offers activities such as bowling, laser tag, ropes course, video games, and VR experiences. You are tasked with writing a program that calculates the cost for a selected package, number of people, and duration. Each package charges a minimum fee for the first hour, and an additional fee every hour in excess of the first hour. The maximum duration possible for reserving an event is 4 hours. There is a maximum charge for an event. There is a minimum number of guests and a maximum number of guests for each package. The package covers all the activities except food. Food is separate cost, on a per person basis. Your program calculates and prints the total charge for a selected package, the duration, and food (based on the number of people attending). PackageFirst Hour for the event (minimum)Hourly Cost after the First HourMinimum number of guestsMaximum number of guestsCost per person for foodMaximum charge (including food) for an event#1$150$100520$25$595#2$180$120830$22$850#3$200$1501040$20$1050 RequirementsName your program project1_cost.cThe user enters the package selection, enter the number of hours, and number of guests. The program calculates and prints the charge.Your program should validate the package selection. If the selection is not in the range of 1 to 3, print the message "Invalid selection." and exit the program.Your program should validate the hours rented. If the number entered is less than 1 or great than 4, print the message "Invalid hours." and exit the program.Your program should validate the number of guests. If the number of guests entered is less than the minimum number of guests or greater than the maximum number of guests for the package selected, print the message "Invalid number of guests." and exit the program.Examples (your program must follow this format precisely)Example #1:Please select from three packages: 1,2, and 3Enter package selection: 1Enter hours: 3Enter number of guests: 20Charge($): 595 Example #2:Please select from three packages: 1,2, and 3Enter package selection: 2Enter hours: 4Enter number of guests: 10Charge($): 760
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions