Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Using C++ , Doing this assignment. COSC 2336 - Data Structures and Algorithms Assignment 2 We are going to use a variation, and a combination
Using C++ , Doing this assignment.
COSC 2336 - Data Structures and Algorithms Assignment 2 We are going to use a variation, and a combination of different Mario Karts as a theme for some of our exercise questions. We will base most of the game features from Mario Kart 64 and Mario Kart Double Dash. Mario Kart 64 was developed by Nintendo in 1997 for its Nintendo 64 platform. On the other hand, Mario Kart Double Dash was developed in 2003 for Nintendo GameCube platform. In our modified Mario Kart example, we are going to have 8 different characters, three game modes, and three difficulty levels. 1. Let us first store the property values for our game characters. To do that, declare 4 arrays in the global scope called names (string), weights (float), speed (int), accelerations (float). Each array should store the 8 values shown in the table below: 2. Inside the main function declare 4 variables: difficulty (int), mode (int), player I (string), player2 (string). The numeric variables should have a default value of 0 , while the string variables should have an empty string. 3. Write a function called getMode that takes one integer pointer as parameter called m. The function asks for the user to choose between the different game modes, and stores the number chosen in what m is pointing to. There are 3 modes: single player grand prix, 2 players grand prix, or co-op grand prix. 4. Call the getMode function in main and pass the address of mode as a parameter. 5. Write a function called getDifficulty that takes one integer pointer as parameter called d. The function asks for the user to choose the game difficulty, and stores the number chosen in what d is pointing to. There are 3 modes of difficulties: 50cc,100cc, or 150cc. 6. Call the getDifficulty function in main and pass the address of difficulty as a parameter. 7. Write a function called getPlayer that takes one pointer as a parameter: pname a pointer to a string variable. The function displays the character's names and their respective weight. The weight should be displayed as light ( 1.75). The function asks for the user to choose a player name, and stores the name in what pname is pointing to. 8. Depending on the value of the mode, call the getPlayer function in main either once or twice to store the user choice in player 1 , or in both Player 1 and Player 2. 9. Write cout instruction in main to display all the values of the input readStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started