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
AysviL [449]
3 years ago
9

Write a program that asks the user for several days' temperatures and computes the average temperature for that period and how m

any days were above average. First ask the user how many days he\she wants to calculate the average for. Then create an array with that number and ask for the temperature of each day. Store the temps in the array. Then find the average and the number of days above that average. Print the results to the screen.

Computers and Technology
1 answer:
elena-14-01-66 [18.8K]3 years ago
4 0

Answer:

#section 1

<em>no_of_days= int(input('How many days are we geting the average for: ')) </em>

<em>tem=[] </em>

<em>for i in range(no_of_days): </em>

<em>    a= int(input('Enter temperaure: input ' + str(i+1)+'  :')) </em>

<em>    tem.append(a) </em>

<em />

#section 2<em>     </em>

<em>average = round(sum(tem)/len(tem),2) </em>

<em>print('The Average is ',average) </em>

<em>gdays=[] </em>

<em>for i in tem: </em>

<em>    if i > average: </em>

<em>        gdays.append(i) </em>

<em> </em>

<em>print('The following days are greater than the average: ',gdays)</em>

Explanation:

The above code is written in python 3

#section 1:

An input is gotten for number of days that is to be used in the calculation, and an array is created to hold the temperature that will be inputted into the program.

A range of values from [0 - (no_of_days - 1)] is created from the number of days entered, this is done so that the FOR loop can iterate through every number and call for inputs.

The FOR loop prompts the user for an input based on the range and passes that input to an integer data type before appending it to the tem array.

#section 2:

The sum of the new list and the length is used to calculate the average and the it is rounded up to 2 DP, The average is then printed to the screen.

Another FOR loop is used to check which of the days are greater than the average and passes it to another array (<em>gdays)</em>, this array is also printed to the screen.

check the attachment to see how the code works.

You might be interested in
In the range C15:G15, insert a function to calculate the total daily revenue. In the range H11:H15, insert a function to calcula
lina2011 [118]

Answer:

1. =SUM(C15: G15) 2. The first part of second part is =SUM(C11:G11), =SUM(C12:G12), =SUM(C13:G13), =SUM(C14:G14), =SUM(C15:G15).  Last is total revenue and the first four are seating for various classes and the second part of the second question is =SUM(H11: H14)  which is the grand total of seats.

Explanation:

Suppose from C15 to G15, we have five columns and hence five days. So we can have one column for one day, and add there, number of seats. C15: G15 is daily revenue, and C11: G11 ...... C14: G14 is the number of seats each day, and in each class, and thus the above answer. We can have different assumptions, and formula will change according to assumptions. You can use HLOOKUP as well if you want.

3 0
3 years ago
What is the best option for sharing Word documents on a Microsoft network because it provides finer degrees of versioning contro
babymother [125]

Answer:

SharePoint Server

Explanation:

One drive you are not being provided with the opportunities like the versioning, check-outs and content approval. However, through SharePoint Server, you are being leveraged with all these features. Through versioning, you can update the document anytime, and also keep track of previous versions as well as the changes that you are making. Through content approval, you can ensure various members have approved permission privilege with them regarding the publication of the content.

Through checkout and check-ins the users can have control ob the new versions of the document as well as while the check-in the document, they can comment on the changes they have made.

6 0
3 years ago
(25 POINTS) Some applications work on all devices while others work on some devices. True or False?
scoray [572]

Answer:

True.

Explanation:

It is true that some applications work on some devices but not on others. This is so because it depends on the operating system of each device, that is, if the device has an operating system compatible with the application in question, said application will work, but if, on the contrary, the operating system is not compatible, the application will not be useful in this.

7 0
3 years ago
Suppose that the tuition for a university is $10,000 this year and increases 4% every year. In one year, the tuition will be $10
seropon [69]

Answer:

<em>The programming language is not stated; however, I'll answer using Python programming language (</em><em>Se</em><em>e attachment</em><em> </em><em>for</em><em> </em><em>proper </em><em>for</em><em>mat</em><em>)</em>

tuition = 10000

rate = 0.04

for i in range(1,15):

tuition = tuition + tuition * rate

if i <= 10:

print("Year "+str(i)+" tuition:",end=" ")

print(round(tuition,2))

if i == 14:

print("Tuition 4th year after:",end=" ")

print(round(tuition,2))

Explanation:

<em>The first 2 lines initializes tuition and rate to 10000 and 0.04 respectively</em>

tuition = 10000

rate = 0.04

<em>The next line iterates from year 1 to year 14</em>

for i in range(1,15):

<em>This line calculates the tuition for each year</em>

tuition = tuition + tuition * rate

<em>The next 3 lines prints the tuition for year 1 to year 10</em>

if i <= 10:

print("Year "+str(i)+" tuition:",end=" ")

print(round(tuition,2))

<em>The next 3 lines prints the tuition at the 4th year after year 10 (i.e. year 14)</em>

if i == 14:

print("Tuition 4th year after:",end=" ")

print(round(tuition,2))

7 0
3 years ago
Suppose a company A decides to set up a cloud to deliver Software as a Service to its clients through a remote location. Answer
finlep [7]

Answer:

perdonnosee

Explanation:

8 0
3 years ago
Other questions:
  • An undesirable jagged appearance is referred to as
    7·2 answers
  • Computer communications describes a process in which two or more computers or devices transfer ____.
    10·1 answer
  • True false you cannot fill in a callout​
    14·1 answer
  • PreparedStatement ps = connection.prepareStatement("select firstName, mi, lastName from Student where lastName = ?"; ps.setStrin
    5·1 answer
  • The color pattern in which marine organisms are light on the bottom and dark on the top of their bodies camouflaging them agains
    11·1 answer
  • Which of the following laptop features allows users to overcome keyboard size restrictions?
    11·1 answer
  • jeff wants to create a website with interactive and dynamic content. Which programming language will he use?
    11·2 answers
  • Assign the size of userInput to stringSize. Ex: if userInput is "Hello", output is: Size of userInput: 5
    7·1 answer
  • How to use emojis on chromebook without on-screen keyboard
    14·1 answer
  • Which of the following is an example of machine learning?
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!