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
Oxana [17]
2 years ago
15

Design a loop that asks the user to enter a number. The loop should iterate 10

Computers and Technology
1 answer:
yarga [219]2 years ago
4 0

There are actually a couple of questions in here. I'll try to answer them in Python, which kind of looks like psuedocode already.

1. Design a loop that asks the user to enter a number. The loop should iterate 10 times and keep a running total of the numbers entered.

Here, we declare an empty array and ask for user input 10 times before printing a running total to the user's console.

<em>numbers = [] </em>

<em>for i in range(10): </em>

<em>    numbers.append(input("number: "))  </em>

<em>print(f"running total: { ', '.join(numbers) }")</em>

<em />

2. Design a program with a loop that lets the user enter a series of numbers. The user should enter -99 to signal the end of the series. After all the numbers have been entered, the program should display the largest and smallest numbers entered.

Here, we declare an empty array and ask for user input forever until the user types -99. Python makes it really easy to get the min/max of an array using built-in functions, but you could also loop through the numbers to find the smallest as well.

<em>numbers = [] </em>

<em>while True: </em>

<em>    n = int(input("number: ")) </em>

<em>    if n == -99:  </em>

<em>        break </em>

<em>    numbers.append(n) </em>

<em>print(f"largest number: { max(numbers) }")   </em>

<em>print(f"smallest number: { min(numbers) }")    </em>

<em />

You might be interested in
Which of the following is a quality of a mixed economy?
tekilochka [14]

Answer:

Image result for Which of the following is a quality of a mixed economy? 1. Businesses have complete control of what they import. 2. Individuals have complete control of what they export. 3.Leaders determine the wages of individuals without any input from businesses. 4. Government encourages free trade of specific products.

'One main characteristic of a mixed economy is the ownership of goods by both private and government/state-owned entities. Monopolies have the potential to occur in this type of economy, but the government closely monitors this. For the economy to be mixed, the government can control some parts but not all.

Explanation:

6 0
3 years ago
What is one way to measure technological progress?
OLga [1]
You can measure it by the amount of automatisation. The bigger technological process the easier it is to automate systems.
4 0
3 years ago
PLS HELP MEE!!!
kramer

Answer:

starting with lowercase letters, using uppercase letters for the first letter in a new word

Explanation:

starting with a dollar sign, using lowercase for the remaining parts of each word

4 0
2 years ago
What are the events?
erastovalidia [21]

Answer:

a thing that happens or takes place, especially one of importance.

8 0
3 years ago
Lindsay owns a candy store that typically makes all if its sales to tourists visiting a nearby zoo. Why might she decide to set
AVprozaik [17]
B and A. Both answers are correct
3 0
3 years ago
Read 2 more answers
Other questions:
  • 5. Are you more honest in your online communication? Explain your response.
    6·1 answer
  • In hunter-gather societies most hunting was done by
    9·2 answers
  • What acronym is used to reference the data link sublayer that identifies the network layer protocol encapsulated in the frame?
    13·1 answer
  • Identify and explain the three tiers of web-based applications.
    15·1 answer
  • What are issues to consider when deciding to build software in-house or purchase commercial off-the-shelf software (cots)?
    14·1 answer
  • Question 1 Multiple Choice Worth 5 points)
    10·1 answer
  • Which turn best describe news one is connected to the government and is used as a political tool more than as a business product
    12·1 answer
  • Which is not a factor that leads to technological advancement?
    8·1 answer
  • Check My Work Sherri is considering replacing a processor on her laptop. The laptop is running slower than she would like. What
    9·1 answer
  • Which tool ia used to create the world wide web?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!