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
sergey [27]
3 years ago
6

What is the output of the loop for count in range(5): print(count)?

Computers and Technology
1 answer:
DedPeter [7]3 years ago
8 0
The answer would be the first answer
You might be interested in
Software piracy can be described as
Klio2033 [76]
Yes
Because the picture is the answer

3 0
2 years ago
Write a RainFall class that stores the total rainfall for each of 12 months into an array of doubles. The program should have me
RSB [31]

Answer:

Explanation:

The code provided worked for the most part, it had some gramatical errors in when printing out the information as well as repeated values. I fixed and reorganized the printed information so that it is well formatted. The only thing that was missing from the code was the input validation to make sure that no negative values were passed. I added this within the getMonths() method so that it repeats the question until the user inputs a valid value. The program was tested and the output can be seen in the attached image below.

import java.io.*;

import java.util.*;

class Rainfall

{

   Scanner in = new Scanner(System.in);

   private int month = 12;

   private double total = 0;

   private double average;

   private double standard_deviation;

   private double largest;

   private double smallest;

   private double months[];

   public Rainfall()

   {

       months = new double[12];

   }

   public void setMonths()

   {

       for(int n=1; n <= month; n++)

       {

           int answer = 0;

           while (true) {

               System.out.println("Enter the rainfall (in inches) for month #" + n + ":" );

               answer = in.nextInt();

               if (answer > 0) {

                   months[n-1] = answer;

                   break;

               }

           }

       }

   }

   public void getTotal()

   {

       total = 0;

       for(int i = 0; i < 12; i++)

       {

           total = total + months[i];

       }

       System.out.println("The total rainfall for the year is " + total);

   }

   public void getAverage()

   {

       average = total/12;

       System.out.println("The average monthly rainfall is " + average);

   }

   public void getLargest()

   {

       double largest = 0;

       int largeind = 0;

       for(int i = 0; i < 12; i++)

       {

           if (months[i] > largest)

           {

               largest = months[i];

               largeind = i;

           }

       }

       System.out.println("The largest amount of rainfall was " + largest +

               " inches in month " + (largeind + 1));

   }

   public void getSmallest()

   {

       double smallest = Double.MAX_VALUE;

       int smallind = 0;

       for(int n = 0; n < month; n++)

       {

           if (months[n] < smallest)

           {

               smallest = months[n];

               smallind = n;

           }

       }

       System.out.println("The smallest amount of rainfall was " + smallest +

               " inches in month " + (smallind + 1));

   }

   public static void main(String[] args)

   {

       Rainfall r = new Rainfall();

       r.setMonths();

       r.getTotal();

       r.getSmallest();

       r.getLargest();

       r.getAverage();

   }

}

8 0
3 years ago
What is the main difference between a struct and a class?
Kay [80]

Explanation:

A class encapsulates methods, while a struct cannot.

4 0
3 years ago
A professional development plan allows an employee to
drek231 [11]
Answer: (B) evaluate current skill level and determine what skills are necessary to advance

Explanation: A professional development plan is used to assess your current skills and see what’s needed to further advance within the field.
7 0
3 years ago
Escribe como es<br>que la tecnología ayuda al ser humano<br><br><br><br>ayudaaa:)​
strojnjashka [21]

Technology helps people with its multiple tools that it offers to carry out various jobs and tasks in our daily lives, for example: one of those technological tools is the computer and the cell phone, among others, these are the most common and the ones that help us perform tasks, consultations and a variety of things.

6 0
3 years ago
Other questions:
  • Question / UJU
    11·1 answer
  • When Python is running in the interactive mode and displaying the chevron prompt (&gt;&gt;&gt;) - what question is Python asking
    14·1 answer
  • Using the given definition of the Measurable interface: public interface Measurable { double getMeasure(); } Consider the follow
    10·1 answer
  • What are the components inside the case typically draw power from a cable connected to the motherboard instead of being connecte
    6·2 answers
  • Brainly is brainly am I correct ​
    11·2 answers
  • In which step of web design is storyboarding helpful?
    10·1 answer
  • In this project you will write a set of instructions (algorithm). The two grids below have colored boxes in different
    9·2 answers
  • Which statement describes a biotic factor interacting with the environment?
    5·1 answer
  • Reflection image and design
    12·1 answer
  • Which ipconfig command switch would a technician use to display detailed information (such as dns servers and mac addresses)?
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!