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
wlad13 [49]
3 years ago
12

Write a Python program (rainfall.py) to collect data and calculate the average rainfall over a period of years. The program shou

ld first ask for the number of years. Then for each year, the program should ask twelve times, once for each month, for inches of rainfall for that month. At the end, , the program should display the number of months, the total inches of rainfall, and the average rainfall per month for the entire period.
Computers and Technology
1 answer:
Alla [95]3 years ago
4 0

Solution :

def year):

  inches $=[]$

 $\text{count} =0$

  for range(year):

      for j in range:

       print("Enter the for the month in format(r))

          count1

          last = float(())

          inches(last)

  totalRainfall sum(inches)

  totalMonths $=$  count    

  return $\text{totalMonths,totalRainfall}$

 

if __name__ '__main__':

 year = int(input("Enter the $\text{number}$ of years ($\text{Greater than 0}$):\n"))

print("For  $\text{year",year,":")}$

while year :

     year = int(("Enter of years ():\n"))

print("For $\{\}$ months"$.\text{format}$(totalMonths))

print("Total rainfall: ",$\text{totalRainfall}$)

print("Average monthly $\text{rainfall:}$",$\text{totalRainfall/totalMonths}$)

You might be interested in
Write a program that reads in 10 numbers from the user and stores them in a 1D array of size 10. Then, write BubbleSort to sort
Diano4ka-milaya [45]

Answer:

The solution is provided in the explanation section.

Detailed explanation is provided using comments within the code

Explanation:

import java.util.*;

public class Main {

//The Bubble sort method

public static void bb_Sort(int[] arr) {  

   int n = 10; //Length of array  

   int temp = 0; // create a temporal variable  

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

         for(int j=1; j < (n-i); j++){  

           if(arr[j-1] > arr[j]){  

               // The bubble sort algorithm swaps elements  

               temp = arr[j-1];  

               arr[j-1] = arr[j];  

               arr[j] = temp;  

             }  

         }            

         }  

        }

 public static void main(String[] args) {

   //declaring the array of integers

   int [] array = new int[10];

   //Prompt user to add elements into the array

   Scanner in = new Scanner(System.in);

   //Use for loop to receive all 10 elements

   for(int i = 0; i<array.length; i++){

     System.out.println("Enter the next array Element");

     array[i] = in.nextInt();

   }

   //Print the array elements before bubble sort

   System.out.println("The Array before bubble sort");

   System.out.println(Arrays.toString(array));

   //Call bubble sort method

   bb_Sort(array);  

               

   System.out.println("Array After Bubble Sort");  

   System.out.println(Arrays.toString(array));

 }

}

8 0
3 years ago
Which relation is created with the primary key associated with the relationship or associative entity, plus any non-key attribut
konstantin123 [22]

Answer:

- Transform binary or unary M:N relationship or associative entity with its own key.

Explanation:

Transform binary relation is described as the method through which a decimal can easily be converted into binary while the unary relationship is described as a relationship in which both the two participants occurs from the same entity.

In the given case, 'transform binary or unary M:N relationship' can be created using 'the primary key linked with the relationship plus any non-key aspects of the relationship and the primary keys of the related entities' as it displays the existence of a relationship between the occurrences of a similar set of the entity i.e. associative entity here.

5 0
4 years ago
Security and protection as it relates to operating systems is grouped into four categories: Availability, Data integrity, Authen
Ivahew [28]

Answer:

The answer is "Confidentiality".

Explanation:

Data Security is also known as protection against unauthorized computer access, files, and pages through digital information protection. The protection of data also prevents data from bribery.  

  • It applies to both the security of data from unwanted entities being obtained.
  • It allows accessing sensitive data, which may be able to do so.
4 0
4 years ago
Plz answer the following ​
Kruka [31]

Answer:

it trojan

Explanation:

what is the question asking

5 0
3 years ago
Read 2 more answers
Describe the information technology industry today
Volgvan

Answer:

The information technology (IT) sector includes companies that produce software, hardware, or semiconductor equipment, and companies that provide internet or related services.

Explanation:

6 0
2 years ago
Other questions:
  • What can be determined from this selection? Check all that apply. The Tax Info worksheet is currently being viewed. There are th
    6·2 answers
  • When naming a file to upload into an assignment in blackboard, it is okay to use special characters?
    13·1 answer
  • If the computer has an encrypted drive, a ____ acquisition is done if the password or passphrase is available. a. passive b. sta
    8·1 answer
  • Steps in the systems development life cycle​
    15·2 answers
  • E-What is the important of Recycle bin?<br>Ans:​
    12·1 answer
  • Set screw compression and indenter are all types of
    13·2 answers
  • Arrays of structures ________. Group of answer choices None of the above. are automatically passed by reference cannot be passed
    6·1 answer
  • Question 8 (True/False Worth 3 points)
    15·1 answer
  • Which statement is true about hacking?
    11·2 answers
  • In a List of Positive Integers, Set MINIMUM to 1. For each number X in the list L, compare it to MINIMUM. If X is smaller, set M
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!