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
goblinko [34]
3 years ago
7

Monster Collector

Computers and Technology
1 answer:
Lera25 [3.4K]3 years ago
5 0

Answer:

In java:

import java.util.*;

public class Main{

public static void main(String[] args) {

 Scanner input = new Scanner(System.in);

 int monsternum, usernum;

 int count = 0;

 Random rand = new Random();

 String [] monsters = {"wild pikamoo","wild bulbaroar"};

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

     monsternum = rand.nextInt(5);  

     System.out.print("A "+monsters[i]+" appears! Guess a number between 1 and 5: ");

     usernum = input.nextInt();

     if(monsternum == usernum){      count++;      System.out.println("Congratulations, you caught a "+monsters[i]+"!");  }

 else{      System.out.println("You almost had it, but the monster escaped.");  }

 

 }

 System.out.println("There are no more monsters to encounter!");

 System.out.println("You caught "+count+" monsters of 2");

 if(count!=2){      System.out.print("Keep training to be the very best!");  }

 else{      System.out.print("You're the monster collector master!");  }

}

}

Explanation:

This declares monster and user number as integers

 int monsternum, usernum;

Initialize count to 0

 int count = 0;

Call the random object

 Random rand = new Random();

Create a string array to save the monster names

 String [] monsters = {"wild pikamoo","wild bulbaroar"};

Iterate for the 2 monsters

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

Generate a monster number

     monsternum = rand.nextInt(5);  

Prompt the user to take a guess

     System.out.print("A "+monsters[i]+" appears! Guess a number between 1 and 5: ");

Get user guess

     usernum = input.nextInt();

If monster number and user guess are equal, congratulate the user and increase count by 1

<em>      if(monsternum == usernum){      count++;      System.out.println("Congratulations, you caught a "+monsters[i]+"!");  } </em>

If otherwise, prompt the user to keep trying

<em>  else{      System.out.println("You almost had it, but the monster escaped.");  }  </em>

<em>  } </em>

Print no monsters again

 System.out.println("There are no more monsters to encounter!");

Print number of monsters caught

 System.out.println("You caught "+count+" monsters of 2");

Print user score

<em>  if(count!=2){      System.out.print("Keep training to be the very best!");  } </em>

<em>  else{      System.out.print("You're the monster collector master!");  } </em>

You might be interested in
According to Porter’s five-forces model, the more the forces combine in any instance, the less likely firms will seek competitiv
Fynjy0 [20]

Answer:

The answer is "Option b"

Explanation:

The five-force model is a simple and powerful way to understand the strength of your enterprise system and recognize your future profitability.  

  • It is beneficial because they know the factors, which affect your environment or your company's profitability.
  • It is a widely available methodology, that defines key factors, which can contribute to a competitive edge, that's why option b is correct.

6 0
4 years ago
What are the nicknames for the first generation computers
Gemiola [76]
I believe there were not nicknames for first generation computers.
--
Sorry!
--
6 0
4 years ago
Digital dashboards provide the decision makers with a quick overview of key performance indicators and other key operational sta
Alona [7]

Answer: E) Push reporting

Explanation:

Push reporting is defined as the reporting process in which information is believed to be shared by the reporter among the audience or viewers. Audience does not have any particular knowledge about that subject and basically unaware.Reporter researches about the topic significantly before sharing information.

Other options are incorrect because pull reporting is the reporting in which audience approach to gain knowledge on topic .Adhoc reporting is type of business intelligence mechanism. Exception reporting is reporting of actual task which moved away from expectation. Drill down reporting is exploration of data in layers.

Thus, the correct option is option(E).

6 0
3 years ago
A result of the Gibbons v. Ogden (1824) decision was that states​
rjkz [21]

Answer:

Explanation:

Gibbons v. Ogden (1824) was a historical decision, where the congress of the United Stated wants to regular interstate commerce. This was a legal fight about the potential of the new steamboat navigation, in the Supreme Court of the United States between the best layers in those days.

This decision of the U.S. Supreme Court was Congress had the right to regulate interstate commerce.

4 0
3 years ago
Suppose you are given a data set consisting of nominal attributes, such as color, which takes values such as red, blue, green et
Ratling [72]

Answer:

No, you can´t.

Explanation:

An SVM uses a binary system. In this case the data consists of nominal attributes which can´t be used directly into the SVM.

However, in order to transform this normal attribute into the binary system is necessary to order the information in two sequences, in which the colors are based into two information facts that will give the system the representation that needs.

3 0
4 years ago
Other questions:
  • printStars is a method that accepts a single int argument and returns no value. It prints as many stars as indicated by its argu
    9·1 answer
  • Write an application in which you declare an array of eight first names. Write a try block in which you prompt the user for an i
    7·1 answer
  • Write the equivalent c++ expression for the following algebraic expressions
    11·1 answer
  • count multiples(num1, num2, AND) Description: Returns the number of multiples of N that exist between num1 and num2 inclusive. P
    12·1 answer
  • Why are computers assigned IP addresses
    15·1 answer
  • The question of ________ arises when considering the way in which online marketers gather consumers’ information over the Intern
    6·1 answer
  • Analyzing the role of elements in audio editing and Video
    7·1 answer
  • Do a comment if u hate me.or think im d.U.m b. add a answer if u dont care. thank all the asnwers or report for saying i dont ex
    9·1 answer
  • A salesman has been traveling to different businesses all day to give a sales presentation. Each time, he was starts up his lapt
    12·1 answer
  • Explain why this scenario could put an organization in jeopardy of losing some of its workforce.
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!