C++ program.Your travel agency offers trips to Asian and African countries. This month, you are specifically doing trips to the Philippines (in Asia) and Tunisia (in Africa) and created a program for users to get prices and a boarding ticket. For all Asian countries, you store the name and population information in your program. With African countries, in addition to the name and population, you are also interested in location (North, South, East, West). Create an abstract Country class that holds the country name and population (given by the constructor). There should be two functions: int get_ticket_price and void_print_boarding_pass (which will output a boarding pass as a file-see below)  Using the Country class, create two classes called African_country and Asian_country. The Asian_country class should use the same constructor that the Country class uses and the African_country class constructor should allow for the user to enter the location (see sample run). Additionally, the two functions in the Country class should be implemented given the following information: For Asian countries, the price is calculated by multiplying the population by 5 unless your name is Pinoy Traveler. If that is your name, your ticket price is $100.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Make C++ program.Your travel agency offers trips to Asian and African countries. This month, you are specifically doing trips to the Philippines (in Asia) and Tunisia (in Africa) and created a program for users to get prices and a boarding ticket. For all Asian countries, you store the name and population information in your program. With African countries, in addition to the name and population, you are also interested in location (North, South, East, West).

  1. Create an abstract Country class that holds the country name and population (given by the constructor). There should be two functions: int get_ticket_price and void_print_boarding_pass (which will output a boarding pass as a file-see below) 

  2. Using the Country class, create two classes called African_country and Asian_country. The Asian_country class should use the same constructor that the Country class uses and the African_country class constructor should allow for the user to enter the location (see sample run). Additionally, the two functions in the Country class should be implemented given the following information:

    1. For Asian countries, the price is calculated by multiplying the population by 5 unless your name is Pinoy Traveler. If that is your name, your ticket price is $100.

    2. For African countries, the price is calculated by multiplying the population by 3 and adding a $1000 travel tax. However, if your name is Moe Traveler and the African country happens to be located in the north, your ticket price is $100.

    3. For boarding passes, a file will be named firstnameboarding.txt (the travelers first name and the word boarding combined). See sample files below for specific structures/messages/content for Asian and African countries

  3. Using these classes, create a program that matches the sample run below (8 points for program matching sample run) (use the created classes . And do not put most of the work in the main):

(Hint: these could be the first lines of code in your main)

Asian_country a1("Philippines", 109); African_country a2("Tunisia",11);

Sample Run:

Creating country object...

Creating country object...
Does Tunisia lie in the north, south, east or west of Africa? None
Please enter a valid location:
north

~~Do you want to go to the Philippines or Tunisia? Philippines
Enter your full name:
Pinoy Traveler

Ticket price will be: $100. Do you still want to go? yes
Boarding pass printed!

Sample files created from sample run:

Pinoyboarding.txt

Passenger name: Pinoy Traveler Destination: Philippines
---Enjoy Asia!---

Randomboarding.txt

Passenger name: Random Traveler Destination: Philippines
---Enjoy Asia!---

Moeboarding.txt

Passenger name: Moe Traveler Destination: Tunisia
---Have fun in North Africa!---

Superboarding.txt

Passenger name: Super Traveler Destination: Tunisia
---Have fun in North Africa!---

Note for African countries, the location is included in the final message (above, North is included)

~~Do you want to go to the Philippines or Tunisia? Philippines
Enter your full name:
Random Traveler

Ticket price will be: $545. Do you still want to go? yes
Boarding pass printed!

~~Do you want to go to the Philippines or Tunisia? Tunisia
Enter your full name:
Moe Traveler

Ticket price will be: $100. Do you still want to go? yes
Boarding pass printed!

~~Do you want to go to the Philippines or Tunisia? Tunisia
Enter your full name:
Super Traveler

Ticket price will be: $1033. Do you still want to go? yes
Boarding pass printed!

~~Do you want to go to the Philippines or Tunisia? Tunisia
Enter your full name:
Bored Traveler

Ticket price will be: $1033. Do you still want to go? no

~~Do you want to go to the Philippines or Tunisia? exit

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Algebraic Expressions
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education