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
gulaghasi [49]
3 years ago
14

Produce a program using a loop that requests for 8 floating point numbers from a user.once provided the program should calculate

the average of all numbers that are less than 10.5
​
Computers and Technology
1 answer:
kati45 [8]3 years ago
7 0

Answer:

The program in Python is as follows:

total = 0

count = 0

for i in range(8):

   num = float(input())

   if num < 10.5:

       total+=num

       count+=1

print("Average: ",total/count)

Explanation:

This initializes the total to 0

total = 0

This initializes the count to 0

count = 0

This loop is executed 8 times

for i in range(8):

This request for float number

   num = float(input())

If input is less than 10.5

   if num < 10.5:

The sum is taken

       total+=num

And count is incremented by 1

       count+=1

The loop ends here

This calculates and prints the average

print("Average: ",total/count)

You might be interested in
1. Your task is to process a file containing the text of a book available as a file as follows:A function GetGoing(filename) tha
Irina18 [472]

Answer:

See explaination

Explanation:

#function to count number of characters, words in a given file and returns a list of words

def GetGoing(filename):

file = open(filename)

numbrOfCharacters =0

numberOfWords = 0

WordList = []

#iterate over file line by line

for line in file:

#split the line into words

words = line.strip().split()

#add counn of words to numberOfWords

numberOfWords = numberOfWords + len(words)

#find number of characters in each word and add it to numbrOfCharacters

numbrOfCharacters = numbrOfCharacters + sum(len(word) for word in words)

#append each word from a line to WordList

for word in words:

WordList.append(word)

#display the result

print("The number of characters: ", numbrOfCharacters)

print("The number of Words: ", numberOfWords)

#return the list of words

return WordList

#find matches for keywords given in textlist

def FindMatches(keywordlist, textlist):

for keyword in keywordlist:

keyword = keyword.lower()

print ("The number of occurrences of {} is: {}".format(keyword,len([i for i, s in enumerate(textlist) if s == keyword])))

#main

booktext = GetGoing("constitution.txt")

FindMatches (['War', 'Peace', 'Power'], booktext)

7 0
3 years ago
Edward Steichen was very famous in the history of photography. Why was he famous
BaLLatris [955]

Answer:

He retired from fashion and commercial photography in 1937. ... Two years after he retired from the Navy, Edward Steichen became the director of the Photography Department at the Museum of Modern Art in New York. There he created what has become the most famous photographic exhibition of all time, The Family of Man.

pls mark me as brainliest

4 0
3 years ago
What is an example of new technology having a negative impact on sustainability?.
Talja [164]

An example of new technology having a negative impact on sustainability is the use of computer automation to shut down unused electronic devices.

<h3>What is technology?</h3>

Technology can be defined as a field of science that involves the process of creating, applying, and managing scientific knowledge and ideas, so as to effectively and efficiently proffer solutions to various problems and cause an improvement in human life.

<h3>What is a computational sustainability?</h3>

Computational sustainability can be defined as a process through which societal, economic, ecological and societal resources are balanced for the future well-being of humanity, especially by developing computational models and using mathematical and information science techniques.

In this context, we can infer and logically deduce that an example of new technology having a negative impact on sustainability is the use of computer automation to shut down unused electronic devices.

Read more on computational sustainability here: brainly.com/question/25719495

#SPJ1

6 0
1 year ago
Which type of operating system is usually used in personal computers?
jeyben [28]

Answer:

A GUI based operating system is usually used in personal computers

Explanation:

The three most common operating systems for personal computers are Microsoft Windows, macOS, and Linux. Modern operating systems use a graphical user interface, or GUI (pronounced gooey).

4 0
2 years ago
Which type of processing best describes the correction of errors or the rearrangement of a job's running time?
Neko [114]

Answer:

Real-time

Explanation:

i am sure because on my test it said corect

6 0
3 years ago
Other questions:
  • You have an insurance policy with a $300 premium and a $500 deductible. How much should you expect to pay the insurance company
    15·1 answer
  • Explain what mistake Miranda made in the following scenario. Situation: Miranda suspects that there may be a problem with the ha
    13·2 answers
  • Given a one dimensional array arr, what is the correct way ofgetting the number of elements in arr
    15·1 answer
  • (Business: check ISBN-10) An ISBN-10 (International Standard Book Number) consists of 10 digits: d1d2d3d4d5d6d7d8d9d10. The last
    9·1 answer
  • Just answer in five-line. Question:
    9·1 answer
  • Write a method that takes a Regular Polygon as a parameter, sets its number of sides to a random integer between 10 and 20 inclu
    10·1 answer
  • What are the network topologies? Advantages and disadvantages.
    9·1 answer
  • One way to initiate a file download from a web page is to
    8·1 answer
  • The action of entering data into your computer. This can be text typed in a word processing document, keywords entered in a sear
    8·1 answer
  • What command utilizes the limpel-ziv (lz77) compression algorithm and achieves a compression ratio of 60-70 percent?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!