Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using If and else and switch, how would you write code that would display 3 every time a 1 is rolled with any other numbered

Using If and else and switch, how would you write code that would display 3 every time a 1 is rolled with any other numbered dice?

For example:

die roll 5, 1 = 3 , roll 4,1 =3 , roll 1,1 =3 and so on

die roll 1, 6 = 3 , roll 1, 4=3 , roll 1, 2= 3 and so on

Note: everything should roll the same unless a 1 is invovled

Thank-you

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

Students also viewed these Databases questions