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
denis-greek [22]
2 years ago
9

Define a function FindLargestNum() with no parameters that reads integers from input until a negative integer is read. The funct

ion returns the largest of the integers read
Computers and Technology
1 answer:
Phoenix [80]2 years ago
6 0

The FindLargestNum program is an illustration of function; where its execution is done when its name is called or evoked

<h3>The function FindLargestNum </h3>

The FindLargestNum function written in Python, where comments are used to explain each action is as follows:

#Thie defines the FindLargestNum function

def FindLargestNum():

   #This gets the first input

   num = int(input())

   #This initializes the minimum value

   maxm = num

   #The following is repeated until the user enters a negative input

   while num >= 0:

       #This determines the largest input

       if num > maxm:

           maxm = num

       #This gets the another input

       num = int(input())

   #This prints the largest input

   print(maxm)

Read more about functions at:

brainly.com/question/24941798

You might be interested in
The definition of an "analog device" is that it is a type of _____.
sveta [45]
ITS C hope it helps goo luck!
5 0
3 years ago
Implement a function inValues() that asks the user to input a set of nonzero floating-point values. When the user enters a value
elena-s [515]

Answer:

Explanation:

The following is written in Python and uses exception handling to do exactly as requested. It then goes adding all of the integer values to an array called num_list and finally adding them all together when the function ends.

def in_values():

   num_list = []

   while True:

       try:

           num = input("Input non-zero floating point: ")

           num = int(num)

           if num == 0:

               break

           else:

               num_list.append(num)

       except ValueError:

           print("No valid integer! Please try again ...")

           try:

               num = input("Input non-zero floating point: ")

               num = int(num)

               break

           except ValueError:

               break

   sum = 0

   for number in num_list:

       sum += number

   return sum

5 0
3 years ago
PLSSS HELLLP!!! THE CROWN WILL BE REWARDED FOR THE CORRECT ANSWER!!!
Sergio039 [100]

Answer:

The audience

Explanation:

The correct option is - The audience

Reason -

When writing a technical document -

Always describe things in technical terms.

Write for your readers.

Describe things exactly as they're described to you by subject matter experts.

Technical writing :

Addresses particular readers.

Helps readers solve problems.

4 0
2 years ago
Programmers refer to programs that contain meaningful names as ____. AnswerThe answer is: Programmers refer to programs that con
andreyandreev [35.5K]
Self documenting, we also make comments.
3 0
2 years ago
Consider the following code segment. The code is intended to read nonnegative numbers and compute their product until a negative
leonid [27]

Answer:

Option D The negative number entered to signal no more input is included in the product

Explanation:

Given the code as follows:

  1.        int k = 0;
  2.        int prod = 1;
  3.        while (k>=0)
  4.        {
  5.            System.out.println("Enter a number: ");
  6.            k= readInt( );
  7.            prod = prod*k;
  8.        }
  9.        System.out.println("product: "+prod);

The line 7 is a logical error. Based on the while condition in Line 3, the loop shall be terminated if k smaller than zero (negative value). So negative value is a sentinel value of this while loop. However, if user enter the negative number to k, the sentinel value itself will be multiplied with prod in next line (Line 7) which result inaccurate prod value.

The correct code should be

  1.        int k = 0;
  2.        int prod = 1;
  3.        while (k>=0)
  4.        {
  5.            prod = prod*k;
  6.            System.out.println("Enter a number: ");
  7.            k= readInt( );
  8.        }
  9.        System.out.println("product: "+prod);
5 0
3 years ago
Other questions:
  • What is are example of an engineered item?
    12·1 answer
  • Write a loop that reads positive integers from standard input and that terminates when it reads an integer that is not positive.
    10·1 answer
  • 12. When trying to identify the sorted column in a table, you would look for the column where A. an arrow is displayed in the fi
    10·2 answers
  • Questiul 2
    10·1 answer
  • Design the logic for a program that allows a user to enter 20 numbers, then displays each number and its difference from the num
    13·1 answer
  • is there anybody out there who is a social butterfly like me? If so then you can tlk to me on this. and to anybody out there tha
    12·1 answer
  • Connect 5 LEDs with any random colors. Iteratively, turn ON 1 to 5 LED(s) that will take 5 iterations in total, and in every ite
    6·1 answer
  • The pay of an hourly worker is calculated by multiplying the hours worked by the hourly rate—up to 40 hours; any hours worked be
    11·1 answer
  • The executive ________ is the person ultimately responsible to their company for the project's success.
    13·1 answer
  • Interstate highway numbers Primary U.S. interstate highways are numbered 1-99. Odd numbers (like the 5 of 95) go north/south, an
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!