Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ Program The simpler the code the better! In a dice game, you get the total you roll on two dice, unless they are the

C++ Program

The simpler the code the better!

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).

Expected values are 4, 16, 7, 4

Given Code:

#include using namespace std;

int main() { //YOUR_CODE }

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

SQL For Data Science Data Cleaning Wrangling And Analytics With Relational Databases

Authors: Antonio Badia

1st Edition

3030575918, 978-3030575915

More Books

Students also viewed these Databases questions