Question: c++ graphics programming. My 'chapulines', this is your assignment: You are to implement a basic trip planner. First draw a graphical representation (simplified map) of

c++ graphics programming.

My 'chapulines', this is your assignment:

You are to implement a basic trip planner. First draw a graphical representation (simplified map) of the cities listed below. Then let a user choose a series of destinations in the map. Assuming the user will start the journey at Acapulco, after every click (representing the next destination), you should:

draw a line joining the current destination to the next destination;

display the distance (in Km) between the current and next destination; and

indicate graphically whether the user will be travelling east or west.

You may assume:

The user will not click outside of the map.

The user will end the trip when a location within 20km of Mexico city is selected as the next destination.

Once the user has selected Mexico City as the next and final destination, you should report at the bottom of the screen (in a location outside of the map) the total distance traveled in Kilometers. Also, since it is a well-known fact that Cuernavaca (my hometown) is the center of the universe, you should display a message indicating how many times the user passes within 50 Km of the center of the universe. Trips that start within 50 Km of Cuernavaca should not count as a pass. Once this process has been completed you should ask the user whether or not to continue and proceed accordingly.

The locations of the cities that are to be represented are given below. You should declare these points as global constants. You are not allowed to use any other global variable in your program.

Cuernavaca (0,0)

Mexico City (0,75)

Acapulco (-50,-225)

Ixtapa (-300,-200)

Salamanca (-225,250)

Morelia (-250,125)

Casitas (300,225)

c++ graphics programming. My 'chapulines', this is your assignment: You are toimplement a basic trip planner. First draw a graphical representation (simplified map)of the cities listed below. Then let a user choose a series

The bare minimum your program should show is listed below:

The 7 cities listed above with their names;

Tick marks every 100 Kilometers and labels every 200 Kilometers.

Some graphical representation of the direction of travel (east or west). I have chosen to draw a truck facing left or right accordingly. Whatever you choose must not be a simple shape like an arrow or a message. The representation must include at least one rectangle and at least one circle.

* I strongly recommend using the following functions:

drawMap -- to draw the basic map of central Mexico on the screen.

drawTruck -- to draw a basic representation of the direction of travel.

connectCities -- to draw a line between two adjacent destinations.

distanceBetweenCities -- to compute the distance between two adjacent destinations.

distanceToCuernavaca (alternatively: distanceToCenterOfTheUniverse) -- to compute the closest distance from a line segment to the center of the map.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!