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
Renee works for a television series. Her responsibility is to transfer data from the camera to a hard drive. What is her job des
Marysya12 [62]

Answer:

Data wrangler

Explanation:

Her responsibility is to transfer data from the camera to a hard drive. What is her job designation? Data Wrangler.

<h2>mark as brainliests </h2>
8 0
2 years ago
Write a method that takes a RegularPolygon as a parameter, sets its number of sides to a random integer between 10 and 20 inclus
Sergio [31]

Answer:

import java.lang.Object

import java.lang.Math

public class RegularPolygon  extends java.lang.Object{

  public void randomize(RegularPolygon c){

       int min = 10, max1 = 20;

       double  min1 = 5, max1 = 12;

       double range = (max - min) + 1;

       double range1 = (max1 -min1) + 1

       int side = (Math.random() * range) + min;

       double len = (Math.random() * range1) + min1;

       c.setNumSides(side);

       c.setSideLength( len);

 }

 public static void main(String[] args) {

    RegularPolygon r = new RegularPloygon();

    randomize(r);

 }

}

Explanation:

The randomize method accepts a regular polygon class as its only parameter and assigns a random number of sides and the length of these sides with the 'Math.random' function.

5 0
3 years ago
32.
qaws [65]

Answer:

a

Explanation:

hackers access your system unauthorized

5 0
3 years ago
In what tab can a user find the workspace option?
Sidana [21]
D. View.
You can find the workspace and preview of the file in View.
4 0
2 years ago
The dns clients that make requests to the dns server are known as ____________.
beks73 [17]
<span>The dns clients that make requests to the dns server are known as : </span>Recursive queries

-Hope this helps.
6 0
3 years ago
Read 2 more answers
Other questions:
  • It is better to know the main components of all computer programming languages
    9·1 answer
  • what is the largest possible number of internal nodes in a redblack tree with black height k? what is the smallest possiblenumbe
    11·1 answer
  • A powerpoint ________ is a set of unified design elements.
    5·1 answer
  • List 5 anti-virus products currently in use
    15·1 answer
  • application that will perform a lot of overwrites and deletes of data and requires the latest information to be available anytim
    8·1 answer
  • Assume that input file references a Scanner object that was used to open a file. Which of the following while loops shows the co
    6·1 answer
  • A device which lets you interact with the computer
    6·2 answers
  • What would give Lucy, an entry-level candidate, an edge over others while she seeks a programmer’s position? Lucy, an entry-leve
    11·1 answer
  • Full meaning of CASE in system analysis
    11·2 answers
  • Define management styles
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!