Answered step by step
Verified Expert Solution
Question
1 Approved Answer
PLEASE DO IT ASAP , ITS BIT URGENT , I AM STUCK IN MY PROJECT , HELP ME ASAP , I WILL DEFINITELY UPVOTE FOR
PLEASE DO IT ASAP , ITS BIT URGENT ,
I AM STUCK IN MY PROJECT ,
HELP ME ASAP , I WILL DEFINITELY UPVOTE FOR THE CORRECT ANSWER
Purpose: Reinforcing basic programming operations (if, for, switch case, use of functions, arrays, etc.) Note: - Pay attention to readability while writing code. - Give meaningful names so that variable names are not confused. - Do not use Turkish characters. - Do not misuse programming operations. o For example: Suppose you have a function called Calculate Area(). This function should only calculate the area, if the value needs to be returned, return it. If the volume is to be calculated, you should think of it as a separate function. - Before you write code, plan what you will do and in what order you will go. your code writing will make it easier. What to do in the Project - Design a menu. o In this menu, there will be two options as Game 1 and Game 2 . o The user will be asked to choose, and Game 1 or Game 2 will be played according to the choice. o After the selected game is finished, it will switch to the game selection menu again. - Define separate functions for Game 1 and Game 2 codes. When choosing from the menu These functions that execute the games must be called. - Things to do for Game 1: o Consider a shooting range where enemies randomly appear on the screen for 1 second and disappear in a straight lane at positions 1-10 along the X-axis. In this range where the mouse can only be moved left and right, the user gets +10 points for each successful headshot. (The images below are drawn so that you can imagine the problem. Nothing will be done visually in the project, only the console screen output requested on the 2 nd page will be written in C programming language.) Example 1: In Example 1, at the 1st second, the user must move his mouse to position 2 in order to successfully shoot at the enemy standing at position 2. Thus, he will have made his successful headshot. Error rate: 22=0. Example 2: In Example 2, at the second second, the user must move his mouse to position 5 in order to successfully shoot at the enemy standing at position 5. Thus, he will have made a successful shot. Error rate: 55=0. Example 3: In Example 3, the user had to move his mouse to position 5 in order to successfully shoot at the enemy standing at position 5 , but moved his mouse to position 2 and fired unsuccessfully. The error rate of the user is 52=3. A : Enemy locations will be randomly adjusted and enemy locations will change 10 times. At each position of the enemy, the user will be asked to enter a number between 1-10 and the total error will be calculated by taking the difference between the randomly generated position values. C that prints the calculated total error on the screen Write the program. B : Apply the user's score according to the features given below. Each hit by the user is +10 points, If each hit is less than or equal to 0.5 units, it means that the enemy was aimed too close, but the enemy could not be fired, and +5 points, If each hit is greater than 0.5 units, he will not receive any points. Write a C program that prints the total score to the screen. C: Write the C program that prints the total number of successful shots, the number of close successful shots and the number of unsuccessful shots in the result of 10 shots. SAMPLE CONSOLE SCREEN OUTPUT OF THE PROJECT IS GIVEN BELOW. Note: You can also suppress the position of the target after each shot so that the target was in this position. hings to do for Game 2: o The program will generate a random number whose 3-digit numbers are different from each other. o Another 3-digit number will be taken from the user to guess this number, and the received number will be compared with the generated one, producing a 3-digit hint number for each guess. According to this number of clues to be created, the user will guess the number again and will have a maximum of 10 rights. o Each unsuccessful attempt will be counted as - 10 points and the score will be reduced from 100 points. will be calculated. y Ex. In Stage 3, the correct guess is 10020=80, The score will be 80. o The 3-digit number generated as a clue in each guess is based on a certain rule. The rule is as follows. o According to the number you enter, the program will search on the randomly generated number and will actually give you a hint for each digit of the number you entered. y The program produced the number 650. You entered 625 as an estimate. Considering that you are scanning from the left, the number " 6 " is both in the number and its location is correct. Therefore, the first digit of our clue number should be assigned " 1.y There is the number "2" in the 2 nd digit. When we scan the number 2 , it is not in the number. The second digit of our tip number should be assigned " 0 " . y There is the number " 5 " in the 3rd digit. When we look at the number produced, there is the number 5 , but its position is wrong. That's why the third digit of our tip number should be "9". y In other words, our clue number has become "109". According to this tip, when the user enters the number 625 , the number 6 is correct in the number produced by the program, the number 2 is not correct, the number 5 exists, but it must be in a different digit. o Hint codes in short: y11> digit and digit location is correct. y9 digit is correct but place of digit is incorrect. y"0" number does not generate numbers. The output of the program will be as follows. Rakamlari birbirinden farkli 3 basamakli random sayi uretilmistir. 1. Tahnininizi giriniz. 789 Ipucu sayiniz: 009 2. Tahnininizi giriniz. 956 Ipucu sayiniz: 190 3. Tahmininizi giriniz. 945 Ipucu sayiniz:101 4. Tahmininizi giriniz. 905 Ipucu sayiniz: 101 5. Tahmininizi giriniz. 935 Ipucu sayiniz: 101 6. Tahmininizi giriniz. 925 Tebrikler 6.Tahmininizde bildiniz.Skorunuz: 5
Step 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