Answered step by step
Verified Expert Solution
Question
1 Approved Answer
***Please do it in C++*** Write a program that takes input age(int type), price (double type) for a air ticket, category(char type). The program calculates
***Please do it in C++***
Write a program that takes input age(int type), price (double type) for a air ticket, category(char type). The program calculates the final price of the air ticket depending on the following criteria . if age or price is less than or equal to ZERO, it should output Wrong input .if age is greater than 0 and less than or equal to 5 and if the category is neither A nor a' discount applied is 100% and if the category is either A or a, discount applied is 0% .if age is greater than 5 and less than or equal to 12 and if the category is neither B nor b, discount applied is 50% and if the category is either B or b, discount applied is 0% .if age is greater than 12 and less than or equal to 26 and if the category is neither C nor C, discount applied is 60% and if the category is either C or c, discount applied is 0% . if age is greater than 26 and less than or equal to 60 and if the category is neither D nor d, discount applied is 70% and if the category is either D or d, discount applied is 0% if age is greater than 60 and if the category is neither E nor e, discount applied is 80% and if the category is either E or e, discount applied is 0% Your program should output the final price. You have to use both if and else statements to write your code Formula for calculating final price final_price price-price discount)/100)Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started