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.
The rates for bus swing
Construct the necessary script to solve the given problem.
#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;
}
Comments
Leave a comment