Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program that calculates the ticket cost of a group coming to BAU ClubFest2021. The program will read three inputs in the following order,

image text in transcribed
Write a program that calculates the ticket cost of a group coming to BAU ClubFest2021. The program will read three inputs in the following order, type of the group as a char (groupType), institution of the group as a char (groupInst), and number of people in the group as an int (groupNbr). The type of the group can be ONLY one of the three following things: SU: Undergraduate student 'G': Graduate student "H": High-school student Institution of the group will be A SINGLE CAPITAL LETTER representing the university name or high-school name (e.g., 'B' for BAU student, 'M' for Marmara University student, etc..). Since this is a Baheehir event, if the groupinst is 'B', then the cost of entrance is free (ie, 0) whether they are high-school, undergraduate, or graduate students. Other than that, we do not accept any high-school students to the Clubfest. So, if the group Type is 'H' and the groupinst is NOT 'B' then the program will say "No admittance". Otherwise, the cost of entrance is 12 per person in the group if the groupType is 'U' and 22 per person if the groupType is 'G'. If admitted, the program will print out the ticket cost of the group as an int value. Input UAB HB8 HC11 Output 36 0 No admittance

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored 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

Recommended Textbook for

Professional IPhone And IPad Database Application Programming

Authors: Patrick Alessi

1st Edition

0470636173, 978-0470636176

More Books

Students also viewed these Databases questions