126,322 views
28 votes
28 votes
Write a program that determines if the user rolled doubles in dive. Read in two integers from the user which represent dice rolls. Create a variable called rolledDoubles which has the value of whether or not the two values are equal. Print that out. Please do this in JAVASCRIPT NOTTT phyton. The picture is what I have so far

Write a program that determines if the user rolled doubles in dive. Read in two integers-example-1
User Rahul K Rajan
by
3.0k points

1 Answer

28 votes
28 votes

Answer:

is it like this?

function start(){

var rolledDice = readInt ("Did you roll double?");

var rolledDoubles = rolledDice <= 6:

println("Dice rolled double:" && rolledDoubles);

if (rolledDoubles){

println("You rolled doubles!");

} else {

println("You did not roll doubles");

}

}

User Mrwalker
by
3.2k points