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
Fynjy0 [20]
3 years ago
10

12. Realizar un algoritmo que genere un número aleatorio, el usuario debe adivinar cual es el número generado para esto tendrá 3

turnos
Computers and Technology
1 answer:
skelet666 [1.2K]3 years ago
3 0

Answer:

Explanation:

El siguiente algoritmo esta escrito en Java y genera un numero aleatorio. Despues le pide al usario que intente adivinar el numero. Si el usario adivina correctamente entoces le dice que fue correcto y termina el programa. Si no adivina bien entonces dice Incorrecto y le pide otra adivinanza al usario hasta llegar a la tercera adivinanza y se termina el programa.

import java.util.Random;

import java.util.Scanner;

class Brainly{

   public static void main(String[] args) {

       Scanner in = new Scanner(System.in);

       Random ran = new Random();

       int numero = ran.nextInt(20);

       for (int x = 0; x <= 2; x++) {

           System.out.println("Adivina el numero entre 0 y 20: ");

           int respuesta = in.nextInt();

           if (respuesta == numero) {

               System.out.println("Correcto");

               break;

           } else {

               System.out.println("Incorrecto");

           }

       }

   }

}

You might be interested in
A company produces coffee makers. The labor cost of assembling one coffee maker during the regular business hours is $2.65. If t
DochEvi [55]

Answer:

520

Explanation:

Let's say the x = smallest number of units that must be assembled during the regular hours, and 660-x is the number of units that can be assembled in overtime. Then, the total cost should be smaller than or equal to cost1 *x + cost2*3.75

⇒ (x * 2.65) + ((660 - x) * 3.75) <= 1903

⇒ x * (2.65 - 3.75) + (660 * 3.75) <= 1903

⇒ 1.1 * x >= 2475 - 1903

⇒ 1.1 * x >= 572

⇒ x >= 520

6 0
4 years ago
What is the default layout position for images added to a Word 2016 document?
murzikaleks [220]

Answer:

D

Explanation:

Hope it works

3 0
3 years ago
Mr chen xi is a vedio maker in singapore . He had created 14GB vedio file for his customer is united states . Name and describe
Kipish [7]

Answer:

Google Drive

Explanation:

It is best he uses the Google Drive to shredded the video with his customers. He may choose to compress the file first using winZip, 7zip or zip softwares. The steps are highlighted below:

-On your computer, go to drive.google.com.

-Open or create a folder.

-To upload files and folders, drag them into the Google Drive folder.

-Share the link to your drive.

(...and remember to share password if folder is encrypted).

Cheers.

7 0
3 years ago
. Find the supplements of : 150' and 70°​
suter [353]
30 is the supplement of 150
7 0
3 years ago
List 7 ways of generating<br>airlines​
rjkz [21]

Answer:

1. <em>impr</em><em>ove</em><em> </em><em>air</em><em> </em><em>qua</em><em>lity</em><em>.</em><em>.</em>

<em>2</em><em>. </em><em>Eats</em><em> </em><em>food</em><em> </em><em>rich </em><em>in</em><em> </em><em>antio</em><em>xidants</em><em>.</em><em>.</em><em>.</em>

<em>3</em><em>. </em><em>Stop</em><em> </em><em>smok</em><em>ing</em><em>.</em><em>.</em><em>.</em><em>.</em>

6 0
3 years ago
Read 2 more answers
Other questions:
  • Investigations involving the preservation, identification, extraction, documentation, and interpretation of computer media for e
    12·1 answer
  • What are the possible sources of the information that defines the functional dependencies that hold among the attributes of a re
    15·1 answer
  • 2.1. The stream cipher described in Definition 2.1.1 can easily be generalized to work in alphabets other than the binary one. F
    10·1 answer
  • Why is it important to use the binomial nomenclature system?
    6·1 answer
  • Which of the following makes a virtual tour different from a printed map
    6·2 answers
  • Most software packages have functions for generating _____ about columns of data, which include statistical summaries like contr
    7·1 answer
  • Various units used to measure computer memory
    13·1 answer
  • /* Write a method called fractionSum that accepts an integer parameter n and
    5·1 answer
  • Explain the working principle of computer with suitable diagram​
    15·1 answer
  • Daily IT Question
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!