Question: C++ Problem 2 (5 points): diceSum Write a function diceSum which takes one integer argument for a desired sum. The function repeatedly rolls two six-sided

C++C++ Problem 2 (5 points): diceSum Write a function diceSum which takes

Problem 2 (5 points): diceSum Write a function diceSum which takes one integer argument for a desired sum. The function repeatedly rolls two six-sided dice until their sum is the desired sum. o Your function MUST be named diceSum . Your function takes one integer argument for the desired sum . Your function should not return anything. . If the desired sum is not between 2 and 12 (inclusive), then print the following message and does not roll the dice. The desired sum should be between 2 and 12 The function prints for each roll in the following output . You rolled a and a The function prints following message once we got the desired sum . Got a in rolls! Make sure that the outcome of the first roll is printed first, and the outcome of the second roll is printed second Please use the rollDie function given below to simulate the roll of a single die. . / rollDie returns a random integer between 1 and 6, works as rolling a die *return value, int number (1-6) int rollDie return random() % 6 + 1

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!