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
Makovka662 [10]
3 years ago
10

Write a program that calculates the average of 4 temperatures. Function 1--write a function to ask a user for 4 temperatures and

return them to main. Validate that none of them is negative. Also return a boolean indicating that the data is good or bad. Function 2--write a value-returning function to calculate the average and return it as a double if the data is good. Display an error message if any score was negative.
Computers and Technology
1 answer:
Andrews [41]3 years ago
7 0

Answer:

Answered below

Explanation:

Answer written in Python programming language

temp_list = []

count = 0

sum = 0

n = 0

is_good = True

def temperatures(temp1, temp2, temp3, temp4){

temp_list = [temp1, temp2, temp3, temp4]

for i in temp_list:

if i < 0:

is_good = False

break

return is_good

}

def average ( ){

if is_good:

for i in temp_list:

sum += i

count++

average = sum / count

return average

}

You might be interested in
Which option allows users to access the handout master to modify it?
Colt1911 [192]

Answer:

in the school store

Explanation:

4 0
3 years ago
How did early games in generation 1 or 2 influence zelda botw
Novay_Z [31]

Answer:

Open world exploration and inventory management

Explanation:

In the first Zelda game (NES) and Zelda ii (NES) there were very early open world mechanics along with inventory management.

5 0
3 years ago
Read 2 more answers
How Extreme Programming addresses Software Testing andevolution ?
kumpel [21]

Answer:

Extreme programming is a software development technique which is used to enhance software quality and it's response to ever changing customer requirements.

Testing

Testing is main focus in extreme programming.Extreme programming addresses testing in a way that if a minute testing can eliminate a bit of flaws, extensive testing can terminate a lot of flaws.

Evolution in Extreme programming is like this:-

Coding:-First programmers will code the problem.

Testing :- Testing is done to remove flaws.

Listening:- Programmers must listen to the customers to what they need.

Designing:-Then design according to the customer needs.

6 0
3 years ago
When is using the Transmission Control Protocol (TCP) most appropriate?
Elodia [21]

Answer:

TCP is typically used when you need a connection-oriented, reliable communication channel.

Most internet protocols (like HTTP, POP, MQTT, ...) have TCP as their underlying protocol.

Only when speed is important and it is acceptable to lose some of the data, you would consider simpler protocols like UDP.

7 0
3 years ago
Why was the microchip essential to improving computers?
-BARSIC- [3]
Because it downsized the scale of the computer itself.

5 0
3 years ago
Other questions:
  • What number is needed to complete the pattern 66, 73, 13, 21, 52,_, 10, 20?
    12·1 answer
  • What does a first line indent look like
    13·1 answer
  • Write a recursive method to compute the following series: 1 + 1/2 + 1/3 + 1/i ... Write a test program that displays m(i) for i
    14·1 answer
  • What is the answer of this question
    10·1 answer
  • Write a program that declares constants to represent the number of inches, feet, and yards in a mile. Name the constants INCHES_
    6·1 answer
  • When doing career research online, you always want to make sure you are viewing a reliable source, what factors about the websit
    10·2 answers
  • What effect does the interconnectedness of modern media have on society?
    14·2 answers
  • Suppose for the worst case, given input size n: Algorithm 1 performs f(n) = n2 + n/2 steps Algorithm 2 performs f(n) = 12n + 500
    6·1 answer
  • You have recently subscribed to an online data analytics magazine. You really enjoyed an article and want to share it in the dis
    9·1 answer
  • Select the correct answer from the drop-down menu.
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!