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
A _______ record is responsible for resolving an ip to a domain name.
katen-ka-za [31]
A DNS record <span>is responsible for resolving an IP to a domain name.
</span>The term DNS record denotes a database record, stored on DNS servers used to map a URL to an IP address. 
 The process is the following: the URL is entered and searched in the browser, that URL is forwarded to the DNS servers and then directed to the specific Web server<span>.</span>
3 0
3 years ago
Which of the following is a requirement for the Safety Data Sheet (SDS)?​
Natasha_Volkova [10]
What are the options?
4 0
3 years ago
WRITE A JAVA PROGRAM TO PRINT THE PATTERN<br> 13579<br> 2468<br> 357<br> 46<br> 5
Inessa05 [86]

Answer:

import java.util.Scanner;

import java.lang.*;

class Main

{

  public static void main(String args[])

  {

     int n;

     //For capturing the value of n

     Scanner scanner = new Scanner(System.in);

     System.out.println("Enter the value of n:");

     //The entered value is stored in the var n

     n = scanner.nextInt();

     int k=1;

     printnum(n,k);  

  }

  public static void printnum(int n,int k)

  {

       if(n%2==0)

       {

       for(int i=k;i<=n-1;i=i+2)

            {

                System.out.print(i);

            }    

        System.out.println("");

       }

       else

        {

       for(int i=k;i<=n-1;i=i+2)

            {

                System.out.print(i);

            }    

        System.out.println("");

        }

      n--;

      if(n<=1)

      {

         System.exit(0);

      }

      else

      {

          printnum(n,k+1);

      }

   }

}

Explanation:

The program is self explanatory.

4 0
3 years ago
Answer the question ASAP please
RUDIKE [14]

Answer:

Shows the programming checking if num1 is greater than num2

Explanation:

So num1 and num2 are inputs

for you to code this you would need to put

num1=int(input("What is your first number? ))

and the same for num2 except change num1 for num 2 and first for second

When the input is completed, the computer will check if num 1 is greater than num2

it will do this by using a code something like:

if num1>num2:

    Print("Your first input was greater than your second")

But in this example if it greater it just ends

But if it was less than you would put

if num1>num2:

    Print("Your first input was greater than your second")

elif num1<num2:

    Print("Your first input is less than your second")

So basically this code shows the computer checking if one number is greater than the other or not

3 0
2 years ago
Read 2 more answers
I'm using assembly language. This is my assignment. I kinda confused about how to write code for this assignment. Can anyone exp
Brut [27]

Answer:

oid changeCase (char char_array[], int array_size ) {

__asm{

   mov eax, char_array;    

   mov edi, 0;

readArray:

   cmp edi, array_size;

   jge exit;

   mov ebx, edi;          

   shl ebx, 2;

   mov cl, [eax + ebx];    

check:

   //working on it

   cmp cl, 0x41;      

   jl next_indx;

   cmp cl, 0x7A;      

   jg next_indx;

   cmp cl, 'a';

   jl convert_down;

   jge convert_up;

convert_down:

   or cl, 0x20;        //make it lowercase

   jmp write;

convert_up:

   and cl, 0x20;      

   jmp write;

write:

   mov byte ptr [eax + ebx], cl    

next_indx:

   inc edi;

exit:

   cmp edi, array_size;

   jl readArray;

mov char_array, eax;

}

}

Explanation:

  • Move char_array to eax as it is base image .
  • Use ebx as offset .
  • Use ecx as the storage register .
  • check if cl is <= than ASCII value 65 (A) .
6 0
3 years ago
Other questions:
  • 4
    10·1 answer
  • Ruby is creating a presentation. She wants each slide displayed at intervals of five seconds. Which feature in the presentation
    6·2 answers
  • ¿Es especial que mi cumpleaños sea el día de San Valentín?<br><br> si o no
    11·2 answers
  • Some numbers are formed with closed paths. the digits 0, 4, 6 and 9 each have 1 closed path and 8 has 2. None of the other numbe
    6·1 answer
  • You want to establish the validity of a test designed for computer technicians using a predictive criterion-related validation s
    9·1 answer
  • what is hyperlink a)the text contained in hypertext documents b)a service provided by the internet c) the location of web pge on
    12·1 answer
  • int temp; temp = 180; if ( temp &gt; 90 ) { System.out.println( "This porridge is too hot." ); // cool down temp = temp – ( temp
    9·1 answer
  • What is the 3 different storage requirements a computer has to process data​
    12·1 answer
  • Convert pounds to ounces.
    11·2 answers
  • What is the bandwidth for asymmetric digital subscriber line<br> (ADSL)?
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!