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
VARVARA [1.3K]
3 years ago
11

Suppose sum and num are int variables, and the input is 18 25 61 6 -1

Computers and Technology
2 answers:
Sphinxa [80]3 years ago
7 0

Answer:

The output is 110 when the question's segment is executed and the input is given as 18,25,61,6,-1.

Explanation:

The program segment is used to add the user input value until the value is not "-1". It means that if a user gives the input "-1" then the program will get terminated and prints the addition of previously entered value by the user. The output is 110 for the input of (18,25,61,6,-1) because the addition of (18,25,61,6) is (110) and "-1" use to terminate the program. The program statement is described below--

  1. The First statement initiates an object of  "Scanner" class which helps to call the input function to take the user input.
  2. The Second statement initializes the 0 value to the "sum" variable which is an integer type.
  3. The Third statement calls the "nextInt()" function to take the user input by the help of scanner class object and store it on a num variable which is an integer type.
  4. The Fourth statement is a "while" loop which gives false when the user's input is "-1".
  5. The Fifth statement adds the new value with the previously added value.
  6. The Sixth statement takes the new input from the user.
  7. The Seventh statement prints the previous added when the loop gets terminated.

charle [14.2K]3 years ago
3 0

Answer:

The program segment is used to add the user input value until the value is not "-1". It means that if a user gives the input "-1" then the program will get terminated and prints the addition of previously entered value by the user. The output is 110 for the input of (18,25,61,6,-1) because the addition of (18,25,61,6) is (110) and "-1" use to terminate the program. The program statement is described below--

The First statement initiates an object of  "Scanner" class which helps to call the input function to take the user input.

The Second statement initializes the 0 value to the "sum" variable which is an integer type.

The Third statement calls the "nextInt()" function to take the user input by the help of scanner class object and store it on a num variable which is an integer type.

The Fourth statement is a "while" loop which gives false when the user's input is "-1".

The Fifth statement adds the new value with the previously added value.

The Sixth statement takes the new input from the user.

The Seventh statement prints the previous added when the loop gets terminated.

THANKS  

0

0.0

(0 votes)

Still have questions?

FIND MORE ANSWERS

ASK YOUR QUESTION

New questions in Computers and Technology

MEASUREMENTS M Immersive Reader BER DE 10/10 Close Assignment • What is Measurement? . When were the two standards used in measurement develop…

The CPU is located on what part of the computer? the motherboard the system bus the random access memory the hard drive

What is the name of the file in which this program is stored: public class myProgram A. myProgram.class B. myProgram.java C. myProgram.jgrasp D. …

Which of the following statements best describes a high level language? A. The syntax is all 1's and O's. B. The syntax is English-like. C. All hi…

Why is it important to explore an Integrated Development Environment? A. To learn more about the syntax of Java B. To learn more about the features…

Common lossless compressed audio file formats include WMA and JIFF WAV and AU MP3 and MP4a FLAC and ALAC

Prog. 6 : 'Atul Transport Company' charges for the parcels from Delhi to Kolkata or vice versa as per the given tariff: Weight Up to 10 kg. For th…

crees que en algun momento haz co.etido algun delito informatico ¿porque?​

How is video compression accomplished? O Video compression works by making the pixel size smaller. O Video compression works by removing the sound…

easy points Cats or dogs? :D

SELECT statement that answers this question: What is the total quantity purchased for each product within each category? Return these columns: categor…

how it print media used? ​

free brainliest in 100 points

Which of the following takes place during the research phase

How do you delete answers on Brain.ly?

which of the following is not a web browser? A. safari B. explorer C. chrome D. google​

The operation of early electronic computing devices required: an operating system (OS). a single human operator. customer-produced helper program …

Which best describes what databases do? O They guarantee users find needed data. O They create categories for data. O They identify important data.…

DO, of X isvvvvvvvvvvvvvvv

Question 27 Which of the following is a key strategy .

Explanation:

You might be interested in
Do individuals have a privacy interest in their smartphones' locations?
Rzqust [24]

Answer:

In today's world, everyone using smartphones as it easily allow to communicate by using different types of features like texting, video, e-mail and by using internet we can run various types of applications.

Smartphones carries one of the main and important skills that is show our current location. By using various types of applications like Global positioning system (GPS), cell ID and wifi we can easily trace the location.

But there is different types of option according to the individual requirement as some people want privacy as they are not interested to share their location to anyone.

6 0
3 years ago
What is the type of data in the list [103, 405, 527, 396, 503]?
Mariulka [41]

Answer:

alphanumeric.........

3 0
3 years ago
Read 2 more answers
your company decides to implement a RAID-5 array on several file servers. Which feature is provided by this deployment
Novay_Z [31]

Answer:

High availability

Explanation:

RAID-5 array is defined as a redundant array for independent disk configuration which makes use of the disk striping with the parity. It consists of a minimum three disk drives and it uses the data striping and the parity data to provide the redundancy.

RAID 5 is a powerful tool to ensure integrity of the data. It provides both performance as well as security to the data.

In the context, "high availability" is the feature that is provided by the deployment of RAID 5 array on the several file services.

4 0
3 years ago
Question # 2
CaHeK987 [17]

Answer:

ZeroDivisionError

ValuError

Explanation: Edg 2020-2021

6 0
3 years ago
Of the three types of mutating malware, what type changes its internal code to one of a set number of predefined mutations whene
Mandarinka [93]
The answer is Oligomorphic malware​.
7 0
3 years ago
Other questions:
  • Business Risks are ​
    15·1 answer
  • 5. In Access, data is stored in a _______ once a form is completed. A. cell B. page C. record D. form
    13·1 answer
  • What is the difference between primary storage,secondary storage and offline storage what type of storage can be
    6·2 answers
  • Cómo se hacían antes las cosas que hoy en día se hacen apoyadas en aplicaciones y software?
    10·1 answer
  • What is the Is option that prints the author of a file​
    7·1 answer
  • study the picture of the simulation and the graph above. based on the information obtained from your study of the simulation and
    11·1 answer
  • Out put of Print (3**2*2)
    13·2 answers
  • 1. (A) What do you mean by computer? Discuss the use of<br> computer in daily life.
    14·2 answers
  • When a ____________ file is opened, it appears full-screen, in slideshow mode, rather than in edit mode.
    6·1 answer
  • write a function named get majority last name that accepts as its parameter a dictionary from strings to strings the keys of the
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!