Question: Implement a simple game using C language which named as What to drink now? Make a Drink.c game program. 1. The program gets the number
Implement a simple game using C language which named as What to drink now? Make a Drink.c game program.
1. The program gets the number of people and asks them one-by-one to make 5 choices in order of their preferences (e.g. 1-Water, 2-Cola, 3-Limonite, 4-Wine, 5-Soda or others). Your program automatically assigns points to the ordered choices (e.g. Water:5, Wine:4 and so on). It calculates the total points and prints a shortlist of preferences that are above a predefined threshold value (e.g. 10). If no choices pass the threshold, you print Drink nowhere! and exit.
2. You ask all players to choose and order their choices from the short list. You add the scores again and print them to screen. The food that gets the top point is ordered.
!!! It can be choosen to "simulate choices by randomly assigning them from a list, you can print a numbered list of items and ask for numeric choices, or you can read - scanf()- any string you like.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
