Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Any chance that the answers for the 1st game can be posted so I can make sure my

ID: 3677429 • Letter: A

Question

Any chance that the answers for the 1st game can be posted so I can make sure my answers match up?

In this assignment you will create a text-based game.

Requirements:

1. Your game must have at least four situations

a. Each situation must have a function that displays the specifics of the situation

b. Each situation must ask the user for a numeric choice such as 1-3 or 1-4. Each situation must call the same function, which should be named GetChoice() and take a min and max value.

c. Each situation must have a function that displays the results of the user choice.

d. You must keep score and display the score in a function called DisplayScore()

2. Your game must have a guessing game a function named DoGuessingGame() in it that asks users to guess a number from 5 to 25

a. Let the user know if their guess is too high or too low.

b. Keep track of the number of guesses.

c. Reward the player's score for fewer guesses

d. Display the score

3. Your game must include a four question quiz where you ask geography questions.

a. The functions and structure of this are up to you. Model the previous sections.

Explanation / Answer

/***** C program for playing a text based game **********/

#include <stdio.h>
#include <stdlib.h>

int min=0, max=0;


void GetChoice() // input min and max
{
printf("Enter a minimum number ");
scanf("%d", &min);

printf("Enter a maximum number ");
scanf("%d", &max);
}


void DisplayScore( int points) // display the current score
{
printf("New points are %d ",points);   
}

int DisplaySituation1() // displaying various situations
{

printf("You will be adding two numbers together ");

}
int DisplaySituation2()
{

printf("You will be subtracting two numbers together ( min from max) ");

}
int DisplaySituation3()
{

printf("You will be multiplying two numbers together ");

}
int DisplaySituation4()
{

printf("You will be dividing two numbers together ( max / min) ");

}

int ResultsSituation1(int min, int max, int points) // adding the min and max situation
{
int sum = min + max;
int UserAnswer1;
printf("What is %d + %d? ", min,max);
scanf("%d", &UserAnswer1);

if (UserAnswer1 == sum)
{
   printf("You got it Right! You Get 5 Points ");
points = points +5;
DisplayScore(points);
}
else
{
printf("Your response is Wrong! You Lost 5 Points ");
points = points -5;
DisplayScore(points);
}
return points;

}

int ResultsSituation2(int min, int max, int points) // subtraction situation
{
int sub = max - min;
int UserAnswer2;
printf("What is %d - %d? ",max,min);
scanf("%d", &UserAnswer2);

if (UserAnswer2 == sub)
{
   printf("You got it Right! You Get 5 Points ");
points = points +5;
DisplayScore(points);
}
else
{
printf("Your response is Wrong! You Lost 5 Points ");
points = points -5;
DisplayScore(points);
}
return points;

}

int ResultsSituation3(int min, int max, int points) // multiplication situation
{
int mul = min * max;
int UserAnswer3;
printf("What is %d * %d? ",max,min);
scanf("%d", &UserAnswer3);

if (UserAnswer3 == mul)
{
   printf("You got it Right! You Get 5 Points ");
points = points +5;
DisplayScore(points);
}
else
{
printf("Your response is Wrong! You Lost 5 Points ");
points = points -5;
DisplayScore(points);
}
return points;

}

int ResultsSituation4(int min, int max, int points) // division situation
{
int div = max/ min;
int UserAnswer4;
printf("What is %d / %d? ",max,min);
scanf("%d", &UserAnswer4);

if (UserAnswer4 == div)
{
   printf("You got it Right! You Get 5 Points ");
points = points +5;
DisplayScore(points);
}
else
{
printf("Your response is Wrong! You Lost 5 Points ");
points = points -5;
DisplayScore(points);
}

return points;

}
  

int main()
{
DisplaySituation1();
GetChoice();
int points = ResultsSituation1(min,max,0);

DisplaySituation2();
GetChoice();
points = ResultsSituation2(min,max,points);

DisplaySituation3();
GetChoice();
points = ResultsSituation3(min,max,points);

DisplaySituation4();
GetChoice();
points = ResultsSituation4(min,max,points);

return 0;
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote