I have included a photo of my Chapter 9 Assignment. It is not due till next Monday since it is Spring Break but I want to do it before I forget.
1. The goal is to use Functions to solve the problems
2. I have to write my own Top Down Design
3. I have to sum a cube?
He wrote this on the board when he explained it.
sqrsum := a*a + b*b + c*c + d*d
The example on the paper use 10 10 10 20 and that returned 11000. But when I so 10*10 + 10*10 + 10*10 + 20*20 I come to a total of 700. I am not understanding this conversion?
How do you find the sum of a cube?
Thanks,
-Lars
1. The goal is to use Functions to solve the problems
2. I have to write my own Top Down Design
3. I have to sum a cube?
He wrote this on the board when he explained it.
sqrsum := a*a + b*b + c*c + d*d
The example on the paper use 10 10 10 20 and that returned 11000. But when I so 10*10 + 10*10 + 10*10 + 20*20 I come to a total of 700. I am not understanding this conversion?
Code:
the code he used on the board
function sqrsum (A,B,C,D : integer) : integer
begin
sqrsum := a*a + b*b + c*c + d*d
.
.
.
How do you find the sum of a cube?
Thanks,
-Lars