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
Ugo [173]
3 years ago
5

Define global variables called highestNum, userInput and sumOfNums and initialize them. In Main call 2 methods: 1) UserData() 2)

DisplayResults()
Task #1:In the UserData() method ask the user to give you a number between 9 and 20, exclusive. Validate this input Then, create a loop that will loop THAT amount of times. Inside that loop generate a random number between 1-100. In that loop check each generated number in order to find the highest number generated. Accumulate all numbers to sumOfNums
Task #2: In the displayResults() method print the following: "There were x numbers generated" "the highest number generated is x" "The sum of the numbers is x" "The average of these numbers is x"
Computers and Technology
1 answer:
Montano1993 [528]3 years ago
5 0

Answer:

Explanation:

The following code is written in Java. It creates the two methods as requested using the Scanner and Random built-in classes in Java. Once the loop is completed and the highestNum is calculated, then the displayResults method is called to print out all the information in the correct format. The output of the program can be seen in the attached image below.

import java.util.Random;

import java.util.Scanner;

class Brainly {

   static int highestNum = 0;

   static int userInput;

   static int sumOfNums = 0;

   public static void main(String[] args) {

       userData();

       displayResults();

   }

   private static void userData() {

       Scanner in = new Scanner(System.in);

       Random rand = new Random();

       System.out.println("Enter a number between 9 and 20: ");

       userInput = in.nextInt();

       if ((userInput >= 9) && (userInput <= 20)) {

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

               int num = rand.nextInt(100);

               if (num > highestNum) {

                   highestNum = num;

               }

               sumOfNums += num;

           }

       }

   }

   public static void displayResults() {

       System.out.println("There were " + userInput + " numbers generated");

       System.out.println("The highest number generated is " + highestNum);

       System.out.println("The sum of the numbers is " + sumOfNums);

       int average = sumOfNums / userInput;

       System.out.println("The average of the numbers is " + average);

   }

}

You might be interested in
Various gabs in the digital divide​
Alisiya [41]

Answer:

factors such as low literacy and income level Geographical restriction lack of motivation motivation of the technology lack of motivation to use technology and digital illiteracy and contribute to the digital device

4 0
3 years ago
What is your understanding about the subject “digital image processing”?
N76 [4]

Answer:

Here's your answer mate.....☺️☺️

Explanation:

In computer science, digital image processing is the use of a digital computer to process digital images through an algorithm. ... It allows a much wider range of algorithms to be applied to the input data and can avoid problems such as the build-up of noise and distortion during processing.

<em><u>Hope it helps </u></em>☺️

5 0
3 years ago
While the economy of eastern Washington relies on farming, western Washington relies on technology.
Strike441 [17]
True- western Washington hosts modern technologies supporting both academic and co curricular activities
3 0
3 years ago
Read 2 more answers
What is one way to establish a team's velocity?
S_A_V [24]

Look at the average Story points completed from the last Iterations.

How To Improve Team Velocity?

Velocity cannot be used to compare teams, as all the teams are different. It also says nothing about how hard the team is working. Velocity is more about efficiency. Velocity should be treated as a team thing, not as an individual one. Some steps to improve team velocity are:

  • Care about team spirit
  • Set clear goals
  • Team members to work on one work at a time
  • Avoid unnecessary steps in the process
  • No micromanagement
  • Define The Process That Is Clear For Everyone
  • Keep Track Of Tech Debt. The team should regularly work on it, to avoid risks and quality problems in the future.
  • Focus On Quality, Not Speed. This will help to reduce the fixes, refactoring time, and increase productivity.
  • Do Not Load The Team Too Much.

To know more about Team Velocity, click on:

brainly.com/question/28174889

#SPJ1

8 0
1 year ago
Hiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
Marianna [84]

Answer:

hello

Explanation:

how are you?

7 0
3 years ago
Other questions:
  • Write a Raptor program that will generate a random number between 1 and 100; do not display the randomly generated number. Let t
    8·2 answers
  • Assume you're using a three button mouse. To connect shortcut menus, you would what
    6·1 answer
  • _____________________ denotes the use of human interactions to gain any kind of desired access. Most often, this term involves e
    11·1 answer
  • Drag each tile to the correct box.
    8·2 answers
  • Please help me. i will mark you brailiest
    6·1 answer
  • Swapping two input integers if they are not the same. (use switch-case
    10·1 answer
  • 5.2
    8·1 answer
  • We have constructed a Player Class for you. Add the following: public static variable: int totalPlayers Static variable should b
    8·1 answer
  • Q Basic program write a program in Q Basic to find the cost of 10 pens when the cost of 15 pens is 75 use unitary method to find
    8·1 answer
  • A Chain of dry-cleaning outlets wants to improve its operations by using data from devices at individual locations to make real-
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!