Complete the following tasks:
a. Create a calcDistance()function template that accepts two parameters representing two distances from a given point. The function returns the total distance as an integer.
b. Create a City class with fields for the city name and for the distance from Chicago, the hub city for Amalgamated Airlines. Overload the + operator to sum the distances to produce a City result in which the city name contains the two operand city names (for example, “New York to Los Angeles”) and the distance contains the total distance.
c. Create a Planet class with fields for the planet name and distance from Earth, the hub planet for the new Amalgamated Galactic Travel Corporation. Overload the + operator to sum the distances to produce a Planet result in which the planet name contains the two operand planet names (for example, “Venus to Mars”) and the distance contains the total distance.
d. Write a main()function that declares several integer, double, and City and Planet objects, and uses the calcDistance()function to compute the distance for several pairs. Save the file as Distance.cpp.
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.