Answer to Question #278501 in C++ for thurga

Question #278501

A ticket booking system program that will ask to enter age of person and will run until user enter the age of last family member. This program will then notify the amount due after each person’s age entered.


The rates for discovery.

  1. Children below 10 are not allowed to sit on the discovery.
  2. 10-15(age) wins 10 % discount AND 15-20 wins 5% discount.
  3. While no for above 20.


The rates for bus swing


  1. 1-5 (age) wins 50 % discount
  2. 5-10 (age) 25% discount
  3. Parking fee which is RM 10/hour
  4. Price of ticket is RM 100.00. 


Construct the necessary script to solve the given problem.




1
Expert's answer
2021-12-11T18:45:39-0500
#include <iostream>


using namespace std;


int main()
{
    int age, price;
    string name;
    cin >> name >> price >> age;


    if (age > 10 && age <= 15)
        price -= price * 10 / 100;
    else if (age < 10)
        cout << "No sits\n";


    // For bus


    if (age >= 1 && age < 5)
        price -= price * 50 / 100;
    else if (age > 5 && age < 10)
        price -= price * 25 / 100;


    cout << price;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog