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
n200080 [17]
3 years ago
9

Write a program that repeatedly reads in integers until a negative integer is read. The program keeps track of the largest integ

er that has been read so far and outputs the largest integer when the (first) negative integer is encountered. (See subsection Example: Finding the max value of section 4.1 Loops (general) to practice the algorithm).
Computers and Technology
1 answer:
vfiekz [6]3 years ago
5 0

Answer:

In Python:

num = int(input("Enter number: "))

maxn = num

while num >=0:

   if num>maxn:

       maxn = num

   num = int(input("Enter number: "))

print("Largest: "+str(maxn))

Explanation:

Get input from the user

num = int(input("Enter number: "))

Initialize the largest to the first input

maxn = num

This loop is repeated until a negative input is recorded

while num >=0:

If the current input is greater than the previous largest

   if num>maxn:

Set largest to the current input

       maxn = num

Get another input from the user

   num = int(input("Enter number: "))

Print the largest

print("Largest: "+str(maxn))

You might be interested in
If you want to code an if clause, but you don't want to perform any action, you can code Select one:
tatyana61 [14]

Answer:

Option A i.e.,  a pass statement are the correct option.

Explanation:

The following option are correct because a pass statement is used when you want to create any function or any loop or statement but you don't want to write code inside the function or any loop or statement then, you use the "pass" keyword inside that function or any loop or statement as null or nothing happen when the following code is execute.

4 0
3 years ago
PLEASE HELP!
Gnom [1K]

Answer:

A. True or false

1.True

2.false

3.false

4.true

5.true

4 0
2 years ago
Read 2 more answers
A device on a power drill that enables a user to back out a drill bit that is stuck in the work material is called a(n) ________
andrew11 [14]
<h2>Answer:</h2><h3>Reversing switch</h3><h2 /><h2>Explanation:</h2><h3>A device on a power drill that enables a user to back out a drill bit that is stuck in the work material is called a(n) <u>Reversing switch</u>.</h3>

A power drill is a electrical component that is used to drill or fast screw tightening and it maybe cordless or with cord. So, when the power drill is used to make hole then by using reverse switch it can be back out by rotating in opposite direction.

  • It is a simple switch operated electrically.
  • It used to reverse the direction in which current is flowing.
  • Reversing switch has four terminals.
  • These terminals can be connected in such a way that when the switch is triggered then the direction or current is reversed and so the rotation of the motor of the power drill is also reversed.

<h3>I hope it will help you!</h3>
8 0
3 years ago
2. Sanjay thinks it's okay to plagiarize because he thinks his instructors won't find out. However, it's
Tatiana [17]
The correct answer is B
8 0
3 years ago
Does this Java Program look correct? First, let me paste the question:Five friends are going to the theater. They have purchased
atroni [7]

Answer:

Your program is correct.

Explanation:

<u>You have this requeriments:</u>

  • James doesn't want to sit next to Jill.
  • Betty and Herb are dating and want to sit next to each other.
  • Bob must sit on an aisle.
  • Aisle on either end.

<u>Your answer:</u>

public class Seating{

public static void main (String [] args)

{ String James;

String Jill;

String Betty;

String Herb;

String Bob;

system.output.println(Bob + "," + Jill + "," + Herb + "," + Betty + "," + James + "."; } <em>//Bob is an aisle. James is not sit next to Jill. Betty and Herb are sit together.</em>

}

4 0
3 years ago
Other questions:
  • hardtack was a. a new cone-shaped bullet. c. a type of biscuit. b. a sharp turn made on command. d. a type of body armor.
    6·1 answer
  • When forced distribution is used to reduce leniency bias, this can cause __________ if a pfp system is in place?
    10·1 answer
  • Find 5 rational numbers between -1 and 1​
    8·1 answer
  • Print the two strings in alphabetical order. assume the strings are lowercase. end with newline. sample output: capes rabbits
    5·2 answers
  • If you write a toString method to display the contents of an object, object1, for a class, Class1, then the following two statem
    7·1 answer
  • The _____ displays numbers with a fixed dollar sign to the left of the number, a comma every three positions to the left of the
    12·1 answer
  • PLEASE HELP!!! <br> Why are Blackberry phones good?
    15·1 answer
  • Can't get Brainly to load on my Apple Mac. Why won’t it load? Does it need another program to work?
    14·2 answers
  • Please help with this question​
    11·1 answer
  • What are the max amount of warnings you get before you get banned?
    11·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!