Question: C Program: Create a program that will prompt the user for the number of die (between 0 and 3) that the user would like the
C Program: Create a program that will prompt the user for the number of die (between 0 and 3) that the user would like the computer to roll. Based on that input, and using if-else statements output the appropriate number of die values (between 1 and 12, we have fancy dice), and sum up the values appearing on the die.
For example, here are a few executions: Please enter the number of die to be rolled: 2 The two die have values of 7 and 12, for a total of 19.
Please enter the number of die to be rolled: 5 We can only roll at most 3 dice.
Please enter the number of die to be rolled: -2 Number of die to be rolled must be greater than 0.
There are three test cases just to get you started, the remaining 7 points will consist of: formatting 2pts, comments 2pts, variable names 1pt, random numbers working properly (should get different die values everytime program is run) 2 points. For a total of 10 points
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
