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
mart [117]
4 years ago
13

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 1*1 2*2 3*3 ... 49*49 50*50 with total. Use no variables other than k and total.
Computers and Technology
1 answer:
Vikentia [17]4 years ago
6 0

Answer:

total=0

def calcsumnumsquare(k,total):

   while k>=1:

       total+=int(k)*int(k)

       k-=1

   return total

print(calcsumnumsquare(4,0))

Explanation:

The program required is written above. It uses only two variables k and total as mentioned in the question. And the total is initially set to 9, and then its value is incremented by the square of each k during each loop established by while loop. And finally, when k=1, the output is returned. And we have printed the return value using print.

You might be interested in
A user is trying to log into windows on her notebook computer. she enters the correct password for her user account, but the sys
ASHA 777 [7]
Try restarting the PC. I have the same issue on Windows 10 sometimes generally its a network error because Windows 10 has a lot of internet required features... 
7 0
4 years ago
Can someone text me cuss I'm bored my number is (225) 975 7120
slavikrds [6]

Be careful sending numbers online, people could easily dox/track you down just for that. Also I won't text you but I wouldn't mind chatting on here

3 0
4 years ago
⦁ ¿Cuáles son los recursos naturales que se utilizan en tu comunidad para generar energía eléctrica?
xxTIMURxx [149]
Turbinas de viento y turbinas de agua son utilizadas, entonces la respuesta podria ser viento y agua
7 0
3 years ago
How can the IOSP model help us to design an app that solves a problem?
docker41 [41]

Answer:

Definition. IOSP. Input Output Server Processor. IOSP. Integrative and Organ Systems Pharmacology (course; various locations)

Explanation:

6 0
3 years ago
Which two statements are true about algorithms?
DENIUS [597]

Answer:

I. Algorithms can be written using pseudocode.

II. Algorithms can be visualized using flowcharts.

Explanation:

An algorithm can be defined as a standard formula or procedures which comprises of set of finite steps or instructions for solving a problem on a computer. The time complexity is a measure of the amount of time required by an algorithm to run till its completion of the task with respect to the length of the input.

The two statements which are true about algorithms are;

I. Algorithms can be written using pseudocode. A pseudocode refers to the description of the steps contained in an algorithm using a plain or natural language.

II. Algorithms can be visualized using flowcharts. A flowchart can be defined as a graphical representation of an algorithm for a process or workflow.

Basically, a flowchart make use of standard symbols such as arrows, rectangle, diamond and an oval to graphically represent the steps associated with a system, process or workflow sequentially i.e from the beginning (start) to the end (finish).

3 0
3 years ago
Read 2 more answers
Other questions:
  • Suppose you define a java class as follows: public class test { } in order to compile this program, the source code should be st
    14·1 answer
  • Design two subclasses of Employee…SalariedEmployee and HourlyEmployee. A salaried employee has an annual salary attribute. An ho
    12·1 answer
  • Renee's creating a plan for her business's information system. What should she do after she determines the goals for her busines
    10·1 answer
  • To save a file so that it can be opened on most computers, select the ____ option.
    10·2 answers
  • Which statement is LEAST accurate? Select one: a. A common reason for ERP failure is that the ERP does not support one or more i
    14·1 answer
  • Tawni made some changes to her file and wants to save the changes in a document with a different title. How can she do this?
    14·2 answers
  • javascript Write a program to calculate the credit card balance after one year if a person only pays the minimum monthly payment
    7·1 answer
  • When the condition of an if statement is false, the computer will return an error message to the user.
    15·2 answers
  • ---------- is a flat fish which swims using its huge side fins.​
    7·1 answer
  • Consider the following code segment. How many unique new (do not count the starting process) processes are created? (you may wan
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!