Saturday
November 1, 2014

Homework Help: algorithm

Posted by alberto on Thursday, July 17, 2008 at 10:13pm.

can someone tell me if this is correct.
Write an algorithm that will display the sum for a given number of squares. In other words if the user enters the value 5, then the output should be 1^2 + 2^2 + 3^2 +4^2 + 5^2 = 55.
sumsquare integer
square integer
count integer
sumsquare := (y^2)
square := 1^2
count := 1
dowhile count = (x)
count = count + 1
sumsquare = sumquare + square
enddo
print\n "sumsquare is ", sumsquare

Answer this Question

First Name:
School Subject:
Answer:

Related Questions

programming - 1. Write a structured algorithm that prompts the user to input two...
Algorithm - write a pseudo code algorithm that will accept the marks in a test ...
Quantum Computing - In this problem, we will carry out some steps of the quantum...
programming - Write an algorithm that converts a decimal number to binary. Then...
physics - n this problem, we will carry out some steps of the quantum factoring ...
Quantum Physics - In this problem, we will carry out some steps of the quantum ...
Algorithm - write a pseudo code algorithm that will accept 20 numbers and finds ...
programming - Write an algorithm that prints the factorial for the first 20 even...
mat 156 - The following algorithm give a correct answer 488 +_65_ 5^1 5^1 3 ...
Algorithm - Write an algorithm to delete the fifth record in a master file of 50...

Search
Members