Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

// INSTRUCTIONS: p5-doWhileLoop p5-do While Loop Rolls: Count: Type your name here

// INSTRUCTIONS:

// Turn on error reporting.

error_reporting(E_ALL);

ini_set('display_errors', '1');

$year = 2021;

$rolls = "";

$count = 0;

//do/while construct

// #1 -- Write a do/while statement that generates a random number in the closed range [1, 6] and

//appends it to the string variable $rolls.

//To generate a random number in a range use the rand() function as in $roll = rand(1, 6);.

//This number simulates the rolling of a single six-sided die.

//Each roll should have a leading space, e.g. 4 1 4 6.

//Each time you roll the die update the value of $count that keeps a running total of the number of rolls.

//Keep generating rolls until you get a 6 at which time the game is over.

//TYPE CODE YOUR HERE

?>

p5-doWhileLoop

p5-do While Loop

© Type your name here

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

More Books

Students also viewed these Databases questions