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
insens350 [35]
2 years ago
12

Create a program that will find and display the largest of a list of positive numbers entered by the user. The user should indic

ate that he/she has finished entering numbers by entering a 0.
Computers and Technology
1 answer:
FinnZ [79.3K]2 years ago
5 0

Answer:

<em>This program is written using Python Programming language,</em>

<em>The program doesn't make use of comments (See explanation section for line by line explanation)</em>

<em>Program starts here</em>

print("Enter elements into the list. Enter 0 to stop")

newlist = []

b = float(input("User Input: "))

while not b==0:

    newlist.append(b)

    b = float(input("User Input: "))

newlist.sort()

print("Largest element is:", newlist[-1])

Explanation:

This line gives the user instruction on how to populate the list and how to stop

print("Enter elements into the list. Enter 0 to stop")

This line creates an empty list

newlist = []

This line enables the user to input numbers; float datatype was used to accommodate decimal numbers

b = float(input("User Input: "))

The italicized gets input from the user until s/he enters 0

<em>while not b==0:</em>

<em>     newlist.append(b)</em>

<em>     b = int(input("User Input: "))</em>

This line sorts the list in ascending order

newlist.sort()

The last element of the sorted list which is the largest element is printed using the next line

print("Largest element is:", newlist[-1])

You might be interested in
A person appreciation of a food taste and flavor is commonly referred to as what
Nimfa-mama [501]

Answer:

Palate - A person’s appreciation of taste and flavor, especially when sophisticated and discriminating Eclectic - Deriving ideas, style, or taste from a broad and diverse range of sources Piquancy - A pleasantly sharp and appetizing flavor

6 0
2 years ago
If you see these REPORT.
Alenkinab [10]

Answer:

ok will do

Explanation:

3 0
2 years ago
Read 2 more answers
How to select the entire worksheet?
Archy [21]
Hey there! Hello! 

In an instance of Microsoft Excel 2016, you can select your entire worksheet by using the Ctrl-A shortcut on your keyboard for Windows, or Command-A in the case of a Mac. If you have a standard Windows keyboard, you should have two Ctrl keys on either side of your keyboard. On a standard Mac keyboard, you'll also find that there are two Command keys on either side of your space key. This shortcut applies to other things as well, such as documents in Word. It basically selects everything there is to select. 

I have attached a screenshot of the result of doing Command-A on a blank document. Everything within the bolded green outline is selected – it's typical for the cell you were on to be white instead of your highlight color (which is grey, in my case), and it will be selected, too. 

Hope this helped you out! Feel free to ask me any additional questions if you have any. :-)

7 0
3 years ago
I need to create a method named "root positive". which will either print the square root of the number passed to it or if the nu
rjkz [21]

Answer:

Explanation:

The following code is written in Java. It is a method that calculates the square root of a number as requested. The method first checks with an IF statement if the parameter value is a positive number and then calculates the square root and prints it to the screen. Otherwise, it prints Number must not be negative. A test case has been provided in the main method and the output can be seen in the attached image below.

import java.util.Scanner;

class Brainly {

   public static void main(String[] args) {

       Scanner in = new Scanner(System.in);

       System.out.print("Enter a number of type double to calculate square root:");

       double num = in.nextDouble();

       rootPositive(num);

   }

   public static void rootPositive(double num) {

       if (num > 0) {

           System.out.println(Math.sqrt(num));

       } else {

           System.out.println("Number must not be negative.");

       }

   }

}

5 0
3 years ago
What is adb command???​
Sedaia [141]

Answer:

<em>Android Debug Bridge (adb) is a versatile command-line tool that lets you communicate with a device. The adb command facilitates a variety of device actions, such as installing and debugging apps, and it provides access to a Unix shell that you can use to run a variety of commands on a device.</em>

Explanation:

<h3>I hope this helps!!</h3>
8 0
2 years ago
Read 2 more answers
Other questions:
  • How do you uninstall a program using the Control Panel?
    10·1 answer
  • Which Internet resource can you use to publicly describe an adventure trip you recently made?
    9·1 answer
  • Set numMatches to the number of elements in userValues (having NUM_VALS elements) that equal matchValue. Ex: If matchValue = 2 a
    6·1 answer
  • Semiconductor memory is used mainly for primary storage even with its high cost. In another hand, the magnetic tape is the cheap
    9·2 answers
  • Select the correct answer.
    9·1 answer
  • What is random access memory?
    6·2 answers
  • PLEASE HELP!!!!!!!!!!! The Excel tool that extends the height of a selected cell so that all the text fits into the cell and is
    10·2 answers
  • What is the maximum current that should be allowed in a 5.0w 220 resistor?
    12·1 answer
  • Full form of NCP?............
    5·2 answers
  • Jamie Lee is beside herself knowing that the thieves had unauthorized use of her debit/ATM card. What is Jamie's financial respo
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!