Question: 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 formHi i have some errors with my code if you could takea look at it thatd be great. #define _CRT_SECURE_NO_WARNINGS #include #include #include

Executed code #define PAUSE system ("pause") int printRandoms(int lower, int upper) { int i;

Errors

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

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

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!