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
cluponka [151]
3 years ago
10

What is the output of the following code fragment? int i = 1; int sum = 0; while (i <= 11) { sum = sum + i; i++; } System.out

.println("The value of sum is " + sum); The value of sum is 65. The value of sum is 66. The value of sum is 55. The value of sum is 56.
Computers and Technology
1 answer:
valentina_108 [34]3 years ago
7 0

Answer:

The value of sum is 66

Explanation:

i = 1

sum = 0

while (i <= 11) {  

sum = sum + i;

i++;  

}

i = 1

  • sum = sum + i
  • sum = 0 + 1
  • sum = 1

i = 2

  • sum = sum + i
  • sum = 1 + 2
  • sum = 3

i = 3

  • sum = sum + i
  • sum = 3 + 3
  • sum = 6

i = 4

  • sum = sum + i
  • sum = 6 + 4
  • sum = 10

i = 5

  • sum = sum + i
  • sum = 10 + 5
  • sum = 15

i = 6

  • sum = sum + i
  • sum = 15 + 6
  • sum = 21

i = 7

  • sum = sum + i
  • sum = 21 + 7
  • sum = 28

i = 8

  • sum = sum + i
  • sum = 28 + 8
  • sum = 36

i = 9

  • sum = sum + i
  • sum = 36 + 9
  • sum = 45

i = 10

  • sum = sum + i
  • sum = 45 + 10
  • sum = 55

i = 11

  • sum = sum + i
  • sum = 55 + 11
  • sum = 66

i = 12 --> does not comply with the condition "i < = 11", the while loop is over

You might be interested in
The common field cricket chirps in direct proportion to the current tem­perature. Adding 40 to the number of times a cricket chi
Luda [366]

Answer:

chirps = int(input("Enter the number of cricket chirps in fifteen seconds: "))

temperature = chirps + 40

print("The temperature is: " + str(temperature))

Explanation:

*The code is in Python.

Ask the user to enter the number of cricket chirps in fifteen seconds

Use the given formula to calculate the temperature (Note that since the user enters the number of cricket chirps in fifteen seconds, I did not divide the sum by 4)

Print the temperature

8 0
4 years ago
Why Prithvi Narayan Shah are appointed the person favoured by the people at Kazi
mart [117]

Answer:

At one time, Prithvi Narayan Shah could not decide who he should as the Kaji (equivalent to Prime Minister) and Pradhan Senapati (Commander-in-Chief). He had two commanders Biraj Thapa Magar and Kalu Pande in mind.

So, for the decision, he called a Bhaardaari Sabhaa (assembly of the courtiers) along with some people of his kingdom and chose Kalu Pande on the basis of popularity. He instructs his descendants in Divyopadesh to understand the popularity before nominating someone as the Kaji.

This is not a true democratic system as the candidates don't really come from between the people. The candidates are the two people who the King thinks are capable and only wants to know who is popular. This only seems like a precursor of democracy we have today.

I would not call Prithvi Narayan Shah was a democratic king, though

Explanation:

3 0
3 years ago
What command would you use to map a share to a drive letter on a computer?
natulia [17]
What are the options
4 0
4 years ago
Bulleted and Numbered List button appear in the ………….. Toolbar.​
stich3 [128]

Answer:

The answer to this question is given below in the explanation section

Explanation:

Bulleted and Numbered List button appear in the <u>Paragraph </u>Toolbar.​

On word processing software, these options display in paragraph toolbar in the Home ribbon.

for example, in MS Word, you can find them in the Home tab under paragraph groups of command.

however, it is noted that these options are appear in some other software under the formating toolbar.

8 0
4 years ago
To make it easier to enter names into your code, NetBeans provides a feature known as
Alexus [3.1K]

Answer:

Code completion.

Explanation:

The NetBeans is an integrated development environment framework of java language. Code completion is the features of NetBeans which is easier to complete the code This feature is known as smart code features because it completes the code in a very easy manner. The Code completion features are needful when we have to fill the missing code or program in the java language.  

Hence Code completion.  is used to enter the name into the code in the  NetBeans.

3 0
3 years ago
Other questions:
  • Write an expression that concatenates the string variable suffix onto the end of the string variable prefix .
    15·2 answers
  • Jane works in the sales department of a service company. She has impressive interpersonal skills and always turns up for work on
    11·2 answers
  • What does "WPA" stand for?
    15·2 answers
  • What mistake is in the following code?
    13·1 answer
  • You want to centrally back up the files users store in the Documents folder in their user profiles, but you don’t want users to
    7·1 answer
  • 2 A_______<br> uses graphics or pictures to help the user navigate and<br> access programs
    14·1 answer
  • What is the first step you should take when you want to open a savings account make your initial deposit go to the bank and fill
    9·1 answer
  • design a relational database in EER for bike helmets and their reviews. a bike helmet has a name and color attributes. a bike co
    12·1 answer
  • We begin with a computer implemented in a single-cycle implementation. When the stages are split by functionality, the stages do
    13·1 answer
  • A company is looking for an employee to help organize customer information for the sales team. Which computer field includes thi
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!