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
Vladimir [108]
2 years ago
6

Use the variables k and total to write a while loop that computes the sum of the squares of the first 50 counting numbers, and a

ssociates that value with total. Thus your code should associate 11 22 33 ... 4949 50*50 with total. Use no variables other than k and total.
Computers and Technology
1 answer:
Tems11 [23]2 years ago
3 0

Answer:

total = 0

k = 1

while k <= 50:

total += k**2

k += 1

print(total)

Explanation:

Note: There some errors in the question. The correct complete question is therefore provided before answering the question as follows:

Use the variables k and total to write a while loop that computes the sum of the squares of the first 50 counting numbers, and associates that value with total. Thus your code should associate 1*1 + 2*2 + 3*3 +... + 49*49 + 50*50 with total. Use no variables other than k and total.

The answer is now explained as follows:

# Initialize k which is the number of term

k = 1

# Initialize total which is the sum of squares

total = 0

# Loop as long as k is less than or equal to 50.

while (k <= 50):

# Add the square of k to total in order to increase it

total = total + k * k

# Increase the value of k by one.

k += 1

# Finally, output total

print (total)

You might be interested in
Interest accumulated on the principle of a loan must also be paid. The accumulated interest is known as which of the following?
tangare [24]
I think B but idk lol
7 0
3 years ago
All of the following are incentives proprietary schools use to attract a student except
IRISSAK [1]
Idk what the answer choices are
4 0
3 years ago
Read 2 more answers
Which of the following techniques can you not use to make the members of the std namespace available to your code? a. Code a usi
Aleksandr-060686 [28]

Answer:

b. Code an include preprocessor directives for the members

Explanation:

Namespace in programming can be defined as the declarative region which provides scope for the identifiers such as the functions, name of the types, variables, etc.

The namespaces are $\text{used to organize}$ the code into the logical groups and also used to prevent the name collision.

The ways that can be used outside the namespace $\text{can access the members}$ as :

-- the code used the fully qualifies name

-- by using the declaration to bring one of the identifier into the scope

-- by using the directive to bring all the things in the newspaper into the scope.

Thus the correct option is (b).

5 0
2 years ago
Why did it take fewer 1-inch tiles than 1-centimeter tiles to measure the length of the cookie cutter?​
Romashka-Z-Leto [24]

The inch tiles are larger, meaning they use less space.

6 0
3 years ago
Mation about which osi layers of connected cisco devices can be verified with the show cdp neighbors comm
fgiga [73]
The show CDP neighbor command operates at the Data link layer (Layer 2)

Cisco Discovery Protocol (CDP) is a proprietary Data Link Layer protocol developed by Cisco Systems. It is used to share information about other directly connected Cisco equipment, such as the operating system version and IP address.

6 0
3 years ago
Other questions:
  • Define a function CoordTransform() that transforms the function's first two input parameters xVal and yVal into two output param
    11·1 answer
  • What does 2/12 mean in time?????
    10·1 answer
  • Web 2.0 has led to a shift just from consuming content towards what
    6·1 answer
  • Claudia has a bachelors degree in computer information systems and she has learned to use some popular software testing tolls wh
    13·2 answers
  • It is important for security practitioners to take into consideration the __________ element when devising password security pol
    15·1 answer
  • Which of the following is not an Operating System? Select one:
    13·1 answer
  • My question is do you learn how to do a voice over in technology?
    14·1 answer
  • An array, numbers, of integers is filled with 100 random numbers whose values are greater than 10 and less than 255. You DO NOT
    7·1 answer
  • The following pieces are known as (image shown above)
    15·2 answers
  • Question 8 of 10
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!