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]
2 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]2 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
Professor Gig A. Byte needs to store text made up of the characters A with frequency 6, B with frequency 2, C with frequency 3,
Luden [163]

Answer:

This is not true

Explanation:

The optimal Huffman code is used to encrypt and compress text files. It uses fixed-length code or variable-length code for encryption and compression of data.

The professor's character code is similar to Huffman's variable-length coding which uses variable length od binary digits to represent the word strings. The file size of the text file above is;

= 6 x 1 + 2 x 2 + 3 x 2 + 2 x 2 + 8 x 1 = 28 bits

This would be the same for both cases.

The encrypt would be the problem as the encoded and decoding of the characters B and E may cause an error.

8 0
2 years ago
What does a file extension tell you?
kiruha [24]

A. because everyone basically has seen it..

3 0
2 years ago
Most _____ focus on galning entry over the internet to a secure computer system by finding a
dangina [55]

Most <u>Malware</u>  focus on gaining entry over the internet to a secure computer system by finding a  working user ID and password combination.

<u>Explanation:</u>

A malware is a small computer program which works on the user’s system without knowing to the user. Different malware works differently.

Some malware sits on the user computer, create multiple unnecessary files and make the hard drive full, some people create viruses to show their computer skills which they tend to prove in a wrong way, some malware sits in the computer to steal data especially while using internet.

So there are malware's like Virus, Worm, Trojan, spyware, etc.

5 0
3 years ago
The___is a waterproof fabric that is placed around your camera
Zina [86]
Can you help me with homework and the answer is a circle
5 0
2 years ago
____________ are the in – built functions that perform a particular pre – defined task when used in a computer program.
saveliy_v [14]

Answer:

System software.

Explanation:

System software are the in-built functions that perform a particular pre-defined task when used in a computer program. An example of a system software is an operating system.

An operating system (OS) is a system software pre-installed on a computing device to manage or control software application, computer hardware and user processes. Some examples of an operating system are QNX, Linux, OpenVMS, MacOS, Microsoft windows, IBM, Solaris, VM etc.

4 0
2 years ago
Other questions:
  • A Hierarchy Custom Setting stores a specific URL for each profile in Salesforce. Which statement can a developer use to retrieve
    5·1 answer
  • What is the use of pecil icon
    11·2 answers
  • Computers heat resistant materials breathing systems for fire fighters food-growing technologies improvements in all of the item
    14·1 answer
  • Should the use of hacktivists by a country against enemy organizations be considered an act of war? Why or why not? How about th
    8·1 answer
  • SHOW ALL YOUR WORK. REMEMBER THAT PROGRAM SEGMENTS ARE TO BE WRITTEN IN JAVA. Assume that the classes listed in the Java Quick R
    9·1 answer
  • Jim, your organizations IAM, has been contacted by the Program Manager to assist in implementing the DIACAP. Jim is not required
    11·1 answer
  • Select the correct word to complete the sentence.
    8·1 answer
  • What is also known as computer Network?
    6·2 answers
  • Samantha is part of a project management team working on the initiation phase of a project. What is her team expected to do in t
    5·2 answers
  • Find the output<br>I need it immediately​
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!