Kat H.

asked • 04/05/21

In a dice game, you get the total you roll on two dice, unless they are the same, in which case you get double what they total. Write a program that helps score the game.

C++.



In a dice game, you get the total you roll on two dice, unless they are the same, in which case you get double what they total. Write a program that helps score the game.


Read in two integers from the console. If they are different, print their sum. If they are the same, print double their sum.

Hint: you are NOT programming the game, just calculating a score from the numbers that get input (presumably after the player rolls the dice).


Code:


#include <iostream>

using namespace std;


int main()

{

//YOUR_CODE

}


1 Expert Answer

By:

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.