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
Help<br> pls need quickly
g100num [7]

Answer:

Themes

Explanation:

  1. In the slide thumbnail pane on the left, select a slide.
  2. On the Design tab, in the Themes group, click the More button (illustrated below) to open the entire gallery of themes:
  3. Point the mouse at the theme you want to apply. Right-click it, and then select Apply to All Slides.
3 0
2 years ago
Write a "for loop" that displays a string in the reverse order (DO NOT use the reverse method) 3.
elena55 [62]

Following are the code in java to reverse any string without using reverse function.

import java.util.*; // import package

class Main // class

{

public static void main(String args[])  // main class in java

{

String s, r = "";  // string variable

Scanner out = new Scanner(System.in);  // scanner classes to take input

System.out.println("Enter a string to reverse");

s = out.nextLine();  // input string

int l1 = s.length();  // finding length of string

l1=l1-1;

for ( int i = l1 ; i >= 0 ; i-- )  // for loop to reverse any string

{

r = r + s.charAt(i);

}

System.out.println(" The Reverse String is: "+r);  // print reverse string

  }

}

Explanation:

firstly we input any string ,finding the length of that string then after that iterating over the loop by using for loop and last display that reverse string

output

Enter a string to reverse

san ran

The Reverse String is: nar nas

5 0
3 years ago
Advantage of realtime processing​
Ray Of Light [21]

Answer:

Advantages of Real-time Software. Maximum system consumption is achieved from real-time software because it produces more output by using all resources while keeping all devices active. There is no or little downtime in such systems. It can be used by hosted servers to get maximum results from hosting companies.

Explanation:

8 0
3 years ago
If someone want to type race with me :
slega [8]

Nah, I am good

But thanks for the points

7 0
3 years ago
Read 2 more answers
When creating an overview visualization of a large dataset, it is most important to:
Lemur [1.5K]

Answer:

a) Display only an important subset of the datapoints so as to not overwhelm the user.

It's important to show only the information that the user needs or requested. The user won't care about other data displayed on the screen that doesn't have anything to do with the information requested.

Displaying more information or extra details that are not needed would only confuse the user and also slow the process. For example, imagine having this data:

  • id_employee
  • name
  • middle_name
  • address
  • birth_date
  • gender
  • role

Some datapoints from the list above could be omitted, depending on which information the user needs to consult. By doing an overview visualization, maybe the user would only like to see the employee's name, role and id.

7 0
2 years ago
Other questions:
  • Where is the error in this code sequence?
    11·1 answer
  • Research the disadvantages of the computer and explain them.​
    15·1 answer
  • Terrence smiles at his customers, helps his coworkers, and stays late when needed. What personal skill does Terrence demonstrate
    10·2 answers
  • Why does the phrase "compatibility mode” appear when opening a workbook?
    6·2 answers
  • Which of the following is most often added to safety glasses to provide better protection from impact and flying particles? A. S
    14·1 answer
  • What is the best game of 2020 in pc​
    12·2 answers
  • Both instructions and data in a digital<br>computer are represented as binary<br>digits. True False​
    13·1 answer
  • What did Bakers wear (1) in the Portugal does (2) when was author was young ???
    10·1 answer
  • You are a developer for a news, entertainment, lifestyle, and fashion website. User traffic has steadily increased month-over-mo
    11·1 answer
  • Barbara, an employee, has properly connected her personal wireless router to a network jack inside her office. The router is una
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!