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
Select the correct answer. Which input device uses optical technology?
daser333 [38]

Answer:

barcode reader is the correct answer

8 0
2 years ago
A vast global network that is made up of many smaller interconnected networks is known as:
Galina-37 [17]

The answer is The Internet.   It is a vast global network that is made up of many smaller interconnected networks. It connects to millions of computer units world wide, in which any computer can communicate with any other computer as long as they are both connected to the Internet. It also made access to information and communication easier.

6 0
3 years ago
Read 2 more answers
Dotted Decimal Notation was created to______________. Group of answer choices provide an alternative to IP addressing express ea
BaLLatris [955]

Answer:

Both b and c

Explanation:

Dotted Decimal notation is a presentation of numerical data which is expressed as decimal numbers separated by full stops. Dotted decimal notation expresses each eight bit sections of 32 bit numbers as decimal value. It provides convenient notation which is easy to understand by the people who are IT experts.

3 0
2 years ago
What is the most appropriate data type for each of these items?
Tom [10]
I may be wrong, BUT here is what i think



b) line graph


d) pie graph
7 0
2 years ago
Write a program in pascal to solve a quadratic equation
GalinKa [24]
Program p1;
var a,b,c,d : integer; {i presume you give integer numbers for the values of a, b, c }
     x1, x2 : real;
begin 
write('a='); readln(a);
write('b='); readln(b);
write('c=');readln(c);
d:=b*b - 4*a*c
if a=0 then x1=x2= - c/b
          else
if d>0 then begin 
                 x1:=(-b+sqrt(d)) / (2*a);
                 x2:=(-b - sqrt(d))/(2*a);
                end;
          else if d=0 then x1=x2= - b /(2*a)
                           else write ("no specific solution because d<0");
writeln('x1=', x1);
writeln('x2=',x2);
readln;
end.
5 0
3 years ago
Other questions:
  • Students can use eNotes to type notes directly on screen and
    11·2 answers
  • 1. Which of the following options will allow you to insert a quick table? (1 point) Insert ribbon &gt; Shapes drop-down menu
    6·2 answers
  • ______ are single numbers or values, which may include integers, floating-point decimals, or strings of characters.
    10·1 answer
  • ____ is an object-oriented programming language from Sun Microsystems which allows small programs called applets to be embedded
    13·1 answer
  • In the MOV instruction both operands i.e. source andthe destination cannot be
    15·2 answers
  • Structured walk-throughs take place throughout the SDLC and are called _____ reviews, depending on the phase in which they occur
    9·1 answer
  • Which of the following scenarios is an example of irrelevant media?
    11·1 answer
  • How do science, mathematics, and technology each influence engineering
    9·2 answers
  • HEYY GUYS START REPORTING ALL THE SPAMMERS PLSS!!!!! For the spammers, I hope you go to hell &gt;:c!!!!!!!!!!!
    14·1 answer
  • Which engineer may design a GPS for a vehicle?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!