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
Alexandra [31]
3 years ago
7

Write a program that repeatedly takes integers from the user as long as he

Computers and Technology
1 answer:
Scorpion4ik [409]3 years ago
7 0

Answer:

Written in Python:

evens = 0

odds = 0

oddtotal = 0

eventotal = 0

total = 0

mylst = []

tryag = "Y"

while tryag == "Y" or tryag == "y":

     num = int(input("Input: "))

     mylst.append(num)

     tryag = input("Another Input (Y/y): ")

mylst.sort()

print("Minimum: "+str(mylst[0]))

print("Maximum: "+str(mylst[-1]))

for i in mylst:

     total = total + i

     if i%2 == 0:

           evens = evens + 1

           eventotal = eventotal + i

     else:

           odds = odds + 1

           oddtotal = oddtotal + i

print("Evens: "+str(evens))

print("Odds: "+str(odds))

print("Even Average: "+str(eventotal/evens))

print("Odd Average: "+str(oddtotal/odds))

print("Total Average: "+str(total/(evens+odds)))

Explanation:

The following lines initializes useful variables to 0

evens = 0

odds = 0

oddtotal = 0

eventotal = 0

total = 0

This declares an empty list

mylst = []

tryag = "Y"

This is repeated until user stops the loop by entering strings other than y or Y

while tryag == "Y" or tryag == "y":

This prompts user for input

     num = int(input("Input: "))

User input is appended to the list

     mylst.append(num)

This prompts user to try again the loop

     tryag = input("Another Input (Y/y): ")

This sorts the list from small to large

mylst.sort()

This prints 1. The minimum

print("Minimum: "+str(mylst[0]))

This prints 2. The maximum

print("Maximum: "+str(mylst[-1]))

The following iterates through the list

for i in mylst:

This calculates the total

     total = total + i

This checks for even entry

     if i%2 == 0:

This counts the number of even entries

           evens = evens + 1

This sums the even entries

           eventotal = eventotal + i

     else:

This counts the number of odd entries

           odds = odds + 1

This sums the odd entries

           oddtotal = oddtotal + i

This prints 3. Sum of Even entries

print("Evens: "+str(evens))

This prints 4. Sum of Odd entries

print("Odds: "+str(odds))

This prints 5. Average of Even entries

print("Even Average: "+str(eventotal/evens))

This prints 6. Average of Odd entries

print("Odd Average: "+str(oddtotal/odds))

This prints 7. Total Average

print("Total Average: "+str(total/(evens+odds)))

You might be interested in
The trademarked name of the accepted standard for configuring wireless networks is _______________
enyata [817]

Answer:

WiFi

Explanation:

WiFi is a standard wireless network configuration developed by IEEE (Institute of Electrical and Electronics Engineers) as a 802.11 standard.

WiFi is embedded in chips in computers and configured for finding wireless routers. WiFi certified points can identify each other, this standardized networks are available almost all online electronic devices.  

Wi-Fi Alliance is the authority to certify devices which satisfy the IEEE 802.11 standards.

3 0
3 years ago
Select the correct answer from each drop-down menu. Rita runs a small business that designs custom furnishings for corporate cli
LUCKY_DIMON [66]

Software as a Service cloud model is ideal for Rita’s business. SaaS are office solutions that allow Rita’s small business to work more efficiently and in a more organized way. Most SaaS applications are used for invoicing and accounting, sales, performance monitoring, and overall planning. SaaS applications can save Rita money. They do not require the deployment of a large infrastructure at her location. As a result, it drastically reduces the upfront commitment of resources. Whoever manages SaaS’s IT infrastructure running the applications brings down fees for software and hardware maintenance. SaaS has generally been acknowledged to be safer than most on-premise software.

5 0
3 years ago
Read 2 more answers
When using a self-contained recovery device on a cfc, hcfc, or hfc system with an operating compressor, technicians must?
Neporo4naja [7]

When using a self-contained recovery device on a cfc, hcfc, or hfc system with an operating compressor. Technicians must recover 80% of the nameplate charge.

Compressor is a mechanical device used in many industries which has the function of increasing gas pressure by reducing its volume. The air compressor is a specific type of gas compressor.

Compressors can be characterized in a number of different ways, but are usually divided into types based on the functional method used to produce compressed air or gas. The following are common compressor types. Types covered include:

  • Pistons
  • Diaphragm
  • Helical Screw
  • Slide propeller
  • Scrolling
  • Rotary Lobe
  • Centrifugal
  • Axial

How to use an air compressor

  1. Position the Air Compressor
  2. Check the Oil Level
  3. Check the Drain Valve
  4. Set the PSI
  5. Prepare the Air Tank
  6. Connect the Air Hose
  7. Connect the Desired Tool
  8. Remove Excess Moisture

You can learn more about compressor here brainly.com/question/26581412

#SPJ4

7 0
1 year ago
Which devices are managed through device management?
mr_godi [17]
Android<span>, </span>iOS<span>, Windows and </span>Blackberry<span> devices.</span>
3 0
3 years ago
Someone hacked into an employee's computer and erased all of their data. All data for the past three weeks was lost as that was
hichkok12 [17]

WWW/ World Wide Web.

7 0
3 years ago
Other questions:
  • What is the binding time for the following in C/C++ program. Explain. a. The location of memory of a local variable in a functio
    9·1 answer
  • An interface is a class that contains only the method headings and each method heading is terminated with a semicolon. True Fals
    7·1 answer
  • Pleas help 99 points and get brainliest
    9·2 answers
  • An important communication principle states ""prepare before you communicate."" How should this preparation manifest itself in t
    10·1 answer
  • Which feature is used to change how a presentation moves from slide to slide?
    14·1 answer
  • Define a function called 'findWordFreq, which takes two parameters. The first parameter, 'text" is an nltk.text.Text object and
    8·1 answer
  • Please help I’m not trying to fail
    7·2 answers
  • What is the computer?​
    9·1 answer
  • What is output?<br> x = 2<br> y = 3<br> print (x * y + 2)<br> 4<br> 2<br> 8<br> 10
    7·1 answer
  • A small square at the right corner of the table is what?​
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!