Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program that calls the random number generator two times to simulate rolling a pair of dice. It should store the two numbers into

Write a program that calls the random number generator two times to simulate rolling a pair of dice. It should store the two numbers into variables. It will then determine if the dice roll is a winner (doubles OR add up to 7). Remember to add two includes and also to seed the random number generator to the clock.

This will roll two dice and add them together.

Doubles, or a total of 7 - YOU ARE A WINNER!!!

First dice: 4

Second dice: 2

BETTER LUCK NEXT TIME

Sample output 2 is given below.

This will roll two dice and add them together.

Doubles, or a total of 7 - YOU ARE A WINNER!!!

First dice: 1

Second dice: 1

YOU WON!!!!

Sample output 3 is given below.

This will roll two dice and add them together.

Doubles, or a total of 7 - YOU ARE A WINNER!!!

First dice: 4

Second dice: 3

YOU WON!!!!

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

Database Horse Betting The Road To Absolute Horse Racing 2

Authors: NAKAGAWA,YUKIO

1st Edition

B0CFZN219G, 979-8856410593

More Books

Students also viewed these Databases questions