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
Given the function definition
kirza4 [7]

output of the following code fragment that invokes Twist is:

1 14 3

Explanation:

In the function Twist(),two parameters are passed. First is passed by value and second is passed by reference. If a variable is passed by value then any change made by the function will not affect the original value of that variable but when a variable is passed by reference then any change made by the function will change the original value of that variable. When Twist() function invokes with a=3 and b=2 then value of c=3+2 i.e c=5, a=3*3 i.e. a=9 (value of "a" was 3 earlier) and and b=c+a i.e b=5+9. Here only "b"is passed by reference for variable "s" then any change in it's value will be reflected in the "s". That will update the value of "s" to 14.

4 0
3 years ago
Implement a recursive method named power that takes 2 integer parameters named base and expo. The method will return the base ra
nika2105 [10]

Answer:

def power(base, expo):

   if expo == 0:

       return 1

   else:

       return base * power(base, expo-1)

Explanation:

*The code is in Python.

Create a method called power that takes base and expo as parameters

Check if the expo is equal to 0. If it is return 1 (This is our base case for the method, where it stops. This way our method will call itself "expo" times). If expo is not 0, return base * power(base, expo-1). (Call the method itself, decrease the expo by 1 in each call and multiply the base)

3 0
3 years ago
The text between and defines the _____.
Genrish500 [490]
Active text on a page
5 0
3 years ago
The advantage of using a spreadsheet is:
Rama09 [41]

because it's a good thing

5 0
2 years ago
What is included on the HP PC Hardware Diagnostics 3-in-1 USB Key that allows you to recover systems that cannot boot?
algol13

Answer:

HP PC Hardware Diagnostics UEFI

Explanation:

The 3-in-1 HP PC Hardware Diagnostics UEFI USB Key helps the client distinguish potential software, hardware, and Operating System issues. Both older and newer HP Desktop and Laptop PCs come with this tool installed. By default, it operates outside the OS to detach equipment issues from other system issues. In the event you do not have it pre-installed, you can get it from the official HP site.

3 0
4 years ago
Other questions:
  • Write a function called ReverseLetters that takes an input phrase consisting of a single word and reverses the sequence of lette
    15·1 answer
  • Which statement prints "hi" on the screen?
    5·2 answers
  • Identify the false statement.
    8·1 answer
  • To change the way a slide moves from one slide to the next, what tab should be selected?
    12·1 answer
  • 1.) Florida has ____________ roads that are designated as part of the National Highway System.
    12·1 answer
  • Most 4 year colleges want an applicant's scores for all the following except
    12·1 answer
  • the increase and decrease font button and the change text colour button (as shown in the picture )are include in which group ?​
    6·1 answer
  • A list is sorted in ascending order if it is empty or each item except the last one is less than or equal to its successor.
    14·1 answer
  • 11 Select the correct answer. Which external element groups items in a design?
    9·1 answer
  • Question 2 of 25
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!