Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hi i have some errors with my code if you could take a look at it thatd be great. #define _CRT_SECURE_NO_WARNINGS #include #include #include #define

Hi i have some errors with my code if you could take a look at it thatd be great.

#define _CRT_SECURE_NO_WARNINGS #include #include #include #define PAUSE system ("pause")

int printRandoms(int lower, int upper) { int i;

int num = (rand() % (upper - lower + 1)) + lower; return num; }

int main() { int lower = 1, upper = 20; int n, p, i = 1, sum = 0, k, f; char q; menu: printf("1.Game Rules "); printf("2.Edit Player Details "); printf("3.Play "); printf("4.Exit "); printf("Please pick an option: ");

printf("This game aims to add up a random number in the range of 1 to 20 each turn to get a final number in the range of 40to 50 "); printf("if the players score is less than 50 after each turn they can choose to continue. "); printf("if they choose to continue, the number of turns will increase by 1. "); printf("The player also looses the game and gets 0 points if the final score is less thanafter deciding to and their turns. "); printf("if the players final score is inthe range of 40 to50, then the final point is equal to the final score subtracting the number of turns the user took to get the final score."); printf("press 0 to go back to the main menu ");

printf("press 1 to edit or 0 to go back to main menu ");

if (sum

if (q == 'y')( goto jump: ) elif (q == 's')( printf("Roburt, you have lost the game") )

}

here's the code in photo formimage text in transcribedimage text in transcribed

Executed code image text in transcribed

Errors

image text in transcribed

Thank you for your help 1 2 3 4 5 #define _CRT_SECURE_NO_WARNINGS #include #include #include #define PAUSE system ("pause") 6 7 8 9 10 pint printRandoms(int lower, int upper) { int i; 11 12 int num = (rand() % (upper - lower + 1)) + lower; return num; } 13 14 15 16 17 18 int main() { int lower = 1, upper = 20; int n, p, i = 1, sum = 0, k, f; 19 char q; 20 21 22 menu: printf("1. Game Rules "); printf("2. Edit Player Details "); printf("3.Play "); printf("4.Exit "); printf("Please pick an option: In "); 23 24 25 26 27 28 29 printf("This game aims to add up a random number in the range of 1 to 20 each turn to get a final number in the range of 40to 50 "); printf("if the players score is less than 50 after each turn they can choose to continue. "); printf("if they choose to continue, the number of turns will increase by 1. "); printf("The player also looses the game and gets a points if the final score is less thanafter deciding to and their turns. "); printf("if the players final score is inthe range of 40 to50, then the final point is equal to the final score subtracting the number of turns the user took to get the final score."); printf("press o to go back to the main menu "); 30 31 32 33 34 printf("press 1 to edit or to go back to main menu "); 35 = 36 37 38 39 40 41 42 43 44 if (sum

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design For Mere Mortals

Authors: Michael J Hernandez

4th Edition

978-0136788041

More Books

Students also viewed these Databases questions

Question

Question Can life insurance be used in a Keogh (HR 10) plan?

Answered: 1 week ago