Question: C++ Program We will construct a short computer game. For your game, the players goal is to reach campus exactly, without over-shooting. The player starts
C++ Program
We will construct a short computer game. For your game, the players goal is to reach campus exactly, without over-shooting. The player starts 14 miles away and has 4 turns to reach campus. At each turn the play can ride either use a Bus, a Subway, or a Jetpack: Riding a Bus moves the player forward 2 miles each turn. Riding a Subway moves the player forward 5 miles each turn Riding a Jetpack moves the player forward 10 mile each turn.
After each turn, the player is informed how much farther she must travel before reaching campus. After the last turn, the player is informed either that she has reached campus (You win!) or that she is not at campus (You lost!). The game will operate as follows: Report how far the user is from campus the player starts 14 miles away For each turn: o Ask user to select transport method (Bus, Subway, or Jetpack). Use a number assigned to each transport method. o Report the users new distance from campus o If the player has reached campus or passed campus and it is not the fourth turn, end the game early This is a more challenging step! Make sure the rest of your game works before working on this step. Report if player has won or lost Requirements: You must use a loop (while, do-while, or for) to loop through the 4 turns. (The loop can include a condition to allow ending early, if you so choose.) o You must use at least one if or switch statement Require that the user must enter one of three numbers to specify the transport method. If the user fails to pick a valid number, the program must keep asking the user for a new selection until she enters a valid number. You do not lose turns by making an invalid selection.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
