1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
andrey2020 [161]
3 years ago
10

"write a program to simulate the rolling of two six-sided dice. the program should work by generating two random numbers, each i

n the range of 1 to 6, to represent the two dice"
Computers and Technology
1 answer:
ehidna [41]3 years ago
5 0
Python:

from random import randint
dice_1 = randint(1, 6)
dice_2 = randint(1, 6)

Java:

int dice1 = (int) (Math.random() * 7);
int dice2 = (int) (Math.random() * 7);
You might be interested in
Forwarded events can only be recorded when systems ADMINISTRATORS have de-established an event subscription. TRUE or FALSE
weeeeeb [17]

Answer:

True

Explanation:

Forwarded events can only be recorded when systems administrators have de-established an event subscription.

8 0
3 years ago
Write a program that initializes an array with ten random integers and then prints four lines of output, containing (Horstmann,
Amiraneli [1.4K]

Answer:

import java.util.Scanner;

import java.util.Random;

public class Solution

{

public static void indexEven(int[] randomNumbers)

{

System.out.print("Even index elements are: ");

for (int i = 0; i < randomNumbers.length; i++)

{

if (i % 2 == 0)

{

System.out.print(randomNumbers[i] + " ");

}

}

System.out.println();

}

public static void evenelement(int[] randomNumbers)

{

System.out.print("Every even element: ");

for (int i = 0; i < randomNumbers.length; i++)

{

if (randomNumbers[i] % 2 == 0)

{

System.out.print(randomNumbers[i] + " ");

}

}

System.out.println();

}

public static void reverseOrder(int[] randomNumbers)

{

System.out.print("All elements in reverse order: ");

for (int i = randomNumbers.length - 1; i >= 0; i--)

{

System.out.print(randomNumbers[i] + " ");

}

System.out.println();

}

public static void firstLast(int[] randomNumbers)

{

System.out.print("First and last elements are: ");

System.out.print(randomNumbers[0] + " " + randomNumbers[randomNumbers.length - 1]);

System.out.println();

}

public static void main(String[] args)

{

// create instance of Random class

Random rand = new Random();

System.out.print("Array: ");

int[] randomNumbers = new int[10];

for (int i = 0; i < randomNumbers.length; i++)

{

randomNumbers[i] = rand.nextInt(100);

System.out.print(randomNumbers[i] + " ");

}

System.out.println();

indexEven(randomNumbers);

evenelement(randomNumbers);

reverseOrder(randomNumbers);

firstLast(randomNumbers);

}

}

Explanation:

8 0
3 years ago
Can you show me how to code this is GDBonline? explaining each statement with notes//
MAVERICK [17]

Answer:

Create two classes, PlayingCard and Main, as depicted in the attachments.

Explanation:

The getters/setters are not actually used in this code, but creating them is pretty standard. Although, you could argue that a PlayingCard object should never change value/suit, and is what it is as long as it exists. Such objects would be called "immutable".

7 0
2 years ago
¿Cuáles son las ventajas de manejar la nube?
igomit [66]

Answer:

What are the advantages of managing the cloud=(Englishish)What are the advantages of managing the cloud?

Lower IT Costs. Businesses requiring IT services save money using third-party providers vs bringing talent in-house. ...

Computing Resources. Heavy computation cycles need extensive hardware resources. ...

Accessibility. ...

Always Updated. ...

Scaling. ...

Backup/Recovery. ...

Integration. ...

Security.

In spanish.....  (Costos de TI más bajos. Las empresas que requieren servicios de TI ahorran dinero utilizando proveedores externos en lugar de traer talento internamente. ...

Recursos informáticos. Los ciclos de computación intensos necesitan amplios recursos de hardware. ...

Accesibilidad. ...

Siempre actualizado. ...

Escalada. ...

Recuperación de respaldo. ...

Integración. ...

Seguridad.)

Explanation:

8 0
3 years ago
The MLA style requires that the works cited be listed in alphabetical order by the author’s last name or, if the work has no aut
svlad2 [7]

Answer:

Answer to the following question is True.

Explanation:

The following statement is True because the Modern Language Association style is the particular type of format that is standard for essays or that papers which is for the research or writing other types of projects or papers in an academic setting. That's why It required for the cited works that should be in the alphabetic manner.

5 0
4 years ago
Other questions:
  • Prompt the user for an automobile service. Each service type is composed of two strings. Output the user's input. (1 pt) Ex: Ent
    9·1 answer
  • A spreadsheet has some values entered: Cell A1 contains 10, cell A2 contains 14, cell A3 contains 7. You enter in cell A4 the fo
    15·2 answers
  • Name three types of data stored on a computer’s hard disk
    11·1 answer
  • The variable used in a loop to control the number of times it is executed is called a _______.
    10·1 answer
  • Spoken word and written word are different because what
    9·1 answer
  • An Administrator wants to have a thank you email sent after the form on the "Request a Demo" landing page is submitted. Where ca
    12·1 answer
  • PLS HELP
    5·1 answer
  • A keyboard would be considered _____. Select 2 options.
    13·2 answers
  • ((Excel)) please help, 100 points, and brain crown thingy, not only that, i will make several of these so you can get several hu
    12·1 answer
  • Choose the answer.
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!