SOLVE IN C PROGRAMMING LANGUAGE Q# 4. Illustrate your knowledge of C-Programming by implementing a 'Game of Dice'. User will start with 3 lives and 100 initial points. Program will ask the user to roll three dices. If sum of three dices is more than or equal to 15, user will get 10 points. If sum is in the range 10 to 14, user will get 5 points. If sum is less than 10, user will get -10 points. If sum is 3, user will lose one life. For every increase of 50 points, user will get one new life and for every decrease of 50 points, user will lose one life. If at any point, user has 200 or more points, program will display message, 'Congratulations, You Win!!!" and end. If user has zero lives or zero points, program will display the message 'Game Over. Sorry, You Lose.' and end. Program will use the following user defined functions to implement the game Function 'DisplavGameRules0' will display the following message on screen. ROLL the DICE GAME HELLO USER, LETS PLAY THE DICE GAME. YOU HAVE 3 LIVES AND 100 POINTS START THE GAME BY ROLLING THREE DICES Function will not take any input arguments and will return nothing. Function RolltheDice) will generate 3 random numbers to represent outcome of three dices. Function will retun the 3 generated numbers. Function ComputeAndDisplayGameStats0' will take the dice outcome, user points and lives as input and update user points and lives according to the rules described above. After updating user points and lives, function will display user points and lives on the screen. Next, program will ask the user, 'Do you want to roll again?". If the user enters 'y' or 'Y', game will repeat, otherwise the program will end.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
Solve in c programming language. Use 'y' or 'Y' to continue to roll dice again.
SOLVE IN C PROGRAMMING LANGUAGE
Q # 4.
Illustrate your knowledge of C-Programming by implementing a 'Game of Dice'. User will
start with 3 lives and 100 initial points. Program will ask the user to roll three dices. If sum of
three dices is more than or equal to 15, user will get 10 points.
If sum is in the range 10 to 14, user will get 5 points. If sum is less than 10, user will get -10
points. If sum is 3, user will lose one life.
For every increase of 50 points, user will get one new life and for every decrease of
50 points, user will lose one life. If at any point, user has 200 or more points, program will
display message, Congratulations, You Win!!!' and end. If user has zero lives or zero points,
program will display the message Game Over. Sorry, You Lose.' and end.
Program will use the following user defined functions to implement the game
Function DisplavGameRules0' will display the following message on screen.
ROLL
the
DICE
GAME
HELLO USER, LETS PLAY THE DICE GAME.
YOU HAVE 3 LIVES AND 100 POINTS
START THE GAME BY ROLLING THREE DICES
Function will not take any input arguments and will return nothing.
Function RolltheDice) will generate 3 random numbers to represent outcome of three dices.
Function will return the 3 generated numbers.
Function ComputeAndDisplayGameStats0' will take the dice outcome, user points and
lives as input and update user points and lives according to the rules described above. After
updating user points and lives, function will display user points and lives on the screen.
Next, program will ask the user, 'Do you want to roll again?". If the user enters 'y' or Y',
game will repeat, otherwise the program will end.
Transcribed Image Text:SOLVE IN C PROGRAMMING LANGUAGE Q # 4. Illustrate your knowledge of C-Programming by implementing a 'Game of Dice'. User will start with 3 lives and 100 initial points. Program will ask the user to roll three dices. If sum of three dices is more than or equal to 15, user will get 10 points. If sum is in the range 10 to 14, user will get 5 points. If sum is less than 10, user will get -10 points. If sum is 3, user will lose one life. For every increase of 50 points, user will get one new life and for every decrease of 50 points, user will lose one life. If at any point, user has 200 or more points, program will display message, Congratulations, You Win!!!' and end. If user has zero lives or zero points, program will display the message Game Over. Sorry, You Lose.' and end. Program will use the following user defined functions to implement the game Function DisplavGameRules0' will display the following message on screen. ROLL the DICE GAME HELLO USER, LETS PLAY THE DICE GAME. YOU HAVE 3 LIVES AND 100 POINTS START THE GAME BY ROLLING THREE DICES Function will not take any input arguments and will return nothing. Function RolltheDice) will generate 3 random numbers to represent outcome of three dices. Function will return the 3 generated numbers. Function ComputeAndDisplayGameStats0' will take the dice outcome, user points and lives as input and update user points and lives according to the rules described above. After updating user points and lives, function will display user points and lives on the screen. Next, program will ask the user, 'Do you want to roll again?". If the user enters 'y' or Y', game will repeat, otherwise the program will end.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY