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
How to take a key off a keyboard without breaking it?
klio [65]
You can carfully wedge something in between the key and gently pull up 
4 0
3 years ago
What report provides data on how specific sections of a website performed?
zalisa [80]

Answer:What report provides data on how specific sections of a website performed? 100% Correct Answer: Content Drilldown report

Explanation: sorry if it’s wrong

3 0
2 years ago
Declare a character variable letterStart. Write a statement to read a letter from the user into letterStart, followed by stateme
oee [108]
  1. Answer: import java.util.Scanner; public class CharTestt {     public static void main(String[] args) {     System.out.println("Please enter a character ");     Scanner input = new Scanner(System.in);     char letterStart = input.next().charAt(0);     char thenextChar = (char)(letterStart+1);     System.out.print(letterStart);     System.out.println(thenextChar); } } Explanation: Import Scanner Class Prompt user to enter a character Read and save user's input in a variable char letterStart = input.next().charAt(0); Knowing that the next character using ASCII is +1, create a new character variable and add 1 print the character entered and the new character all on same line without spaces
5 0
3 years ago
Which daemon manages the physical memory by moving process from physical memory to swap space when more physical memory is neede
Anastasy [175]

Answer:

Swap daemon

Explanation:

Swap daemon manages the physical memory by moving process from physical memory to swap space when more physical memory is needed. The main function of the swap daemon is to monitor processes running on a computer to determine whether or not it requires to be swapped.

The physical memory of a computer system is known as random access memory (RAM).

A random access memory (RAM) can be defined as the internal hardware memory which allows data to be read and written (changed) in a computer.Basically, a random access memory (RAM) is used for temporarily storing data such as software programs, operating system (OS),machine code and working data (data in current use) so that they are easily and rapidly accessible to the central processing unit (CPU).

Additionally, RAM is a volatile memory because any data stored in it would be lost or erased once the computer is turned off. Thus, it can only retain data while the computer is turned on and as such is considered to be a short-term memory.

There are two (2) main types of random access memory (RAM) and these are;

1. Static Random Access Memory (SRAM).

2. Dynamic Random Access Memory (DRAM).

6 0
3 years ago
Which is part of the dales process A customer retention B billing C cost planning D customer relations
serious [3.7K]

Answer:

D customer relations

Explanation:

A sales process is a term that describes a set of predetermined undertakings in which a salesperson perform in order to engage and put up with prospective buyer right from the first stage which is pre-approach to a closed sale.

The sale process involves the following steps:

1. Pre-approach

2. Approaching the customer

3. Determining the needs of customers

4. Introducing the product

5. Handling questions and objections

6. Closing the sale

7. Recommendation selling

8. Encouraging and follow up.

Hence, all the steps involved in the sales process deals with CUSTOMER RELATIONS. Therefore, the right answer is option D.

6 0
3 years ago
Other questions:
  • .2. What approach to deviance do you find most persuasive: that
    9·1 answer
  • It is used to replace numeric number of a website​
    7·1 answer
  • How to jail break iphone 7 with <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="7617023602">[email&#160
    11·2 answers
  • Select a cybersecurity career that interests you. Describe the job duties and identify the skills required to excel in that care
    15·1 answer
  • Complete the sentence about entering and editing data in a cell in a spreadsheet.
    13·1 answer
  • Describe the impact of improvement ls in technology and transportation on american citizens. ​
    7·1 answer
  • Compile and Execute a Program
    13·1 answer
  • What is intellectual property rights law ?​
    8·1 answer
  • How did Bill Gates benefit from free enterprise? Need a paragraph please. Will give the branliest!!
    9·1 answer
  • How many hours do you spend on the Internet per day?
    11·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!