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]
2 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]2 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
Write a paragraph about ICT in personal life?
melisa1 [442]

Answer:

Information and communications technology (ICT) is an extensional term for information technology (IT) that stresses the role of unified communications[1] and the integration of telecommunications (telephone lines and wireless signals) and computers, as well as necessary enterprise software, middleware, storage and audiovisual systems, that enable users to access, store, transmit, and manipulate information.

6 0
2 years ago
Create a function that will perform linear interpolation from a set of measured data stored in a list or array. The function sho
wel

Answer:

This question is incomplete, here is the complete question:

Python

a) You should create a function that will perform linear interpolation from a set of measured data. The function should take as input a list of values at which samples were taken, and then another list giving the measurements (you can assume each measurement is a single value) at those values. It should also take in a query value, and should give the best estimate it can of the value at that query. Be sure to handle values that are outside of the range, by extrapolating. You should write a program that allows you to test your function by reading the lists from a file where each line of the file is a pair of numbers separated by spaces: the value where the sample was taken, and the measurement at that value. Your program should ask the user for the name of the file and for a query value. Important: The two lists will correspond to each other: i.e. for the i-th value in the first list, the measurement will be the i-th element of the second list (these are called parallel lists or arrays). But, you should not assume that the input values are in increasing/decreasing order. That is, the values in the first list can be in any random ordering, not necessarily from smallest to largest or largest to smallest. You will have to account for this in your program, and there is more than one way to do so. You should discuss what options you can think of to handle the data arriving in any order like that, and decide what you think the best option for handling it is.

Explanation:

from __future__ import division

from cStringIO import StringIO

import numpy as np

from scipy.interpolate import RectBivariateSpline

np.set_printoptions( 1, threshold=100, edgeitems=10, suppress=True )

   # a file inline, for testing --

myfile = StringIO( """

# T P1 P2 P3 P4

0,   80,100,150,200

75, 400,405,415,430

100, 450,456,467,483

150, 500,507,519,536

200, 550,558,571,589

""" )

   # file -> numpy array --

   # (all rows must have the same number of columns)

TPU = np.loadtxt( myfile, delimiter="," )

P = TPU[0,1:] # top row

T = TPU[ 1:,0] # left col

U = TPU[1:,1:] # 4 x 4, 400 .. 589

print "T:", T

print "P:", P

print "U:", U

interpolator = RectBivariateSpline( T, P, U, kx=1, ky=1 ) # 1 bilinear, 3 spline

   # try some t, p --

for t, p in (

   (75, 80),

   (75, 200),

   (87.5, 90),

   (200, 80),

   (200, 90),

   ):

   u = interpolator( t, p )

   print "t %5.1f p %5.1f -> u %5.1f" % (t, p, u)

8 0
3 years ago
Who loves you tube , anyone?
kodGreya [7K]

I LIKE IT DO YOU ALSO LOVE IIT

8 0
2 years ago
Read 2 more answers
The _______________ layer of the TCP/IP protocol suite is responsible for making sure that what leaves one end of the network ar
seropon [69]

Answer:

Transport layer

Explanation:

The transport layer is responsible for maintaining end to end communication between devices connected on a network.

The TCP/IP determines how data is exchanged between devices connected on a network by providing end to end communications that determines how it should be broken into packets.

7 0
3 years ago
Which of the following is the term for software that automatically displays or downloads unwanted offers?
slega [8]
Adware. Adware displays ads and popups. The other options are completely different from each other
5 0
3 years ago
Other questions:
  • What is one way for an entrepreneur to decrease risk?
    8·1 answer
  • In Windows Vista, the Run command can be found in which application?
    6·1 answer
  • The continue statement _________.
    11·1 answer
  • As part of the systems engineering development team, use IDEF0 to develop a functional architecture. The functional architecture
    13·1 answer
  • Shira’s Shoes sold 875,000 pairs of sandals in June, which was 70% of the total number of shoes sold. How many shoes did the com
    14·2 answers
  • Which of the examples is part of client-side code?
    12·1 answer
  • How do news organizations primarily create revenue?
    12·2 answers
  • C
    5·1 answer
  • P.W. Singer jokes about how many people are using Wang computers. What point is he making with this joke?
    8·1 answer
  • Resource _____ let you view, manage, and automate tasks on multiple aws resources at a time.
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!