need help to write a sumsquare function module and then rewrite that fuction module into an algorithm from this pseudocode.
count integer
square integer
sumsquare integer
count = 0
square = 1
do while count <= 2
count = count + 1
sumsquare = sumsquare + square
end do
this is not home work or stuff like that, this is a class work which i probably wont get an answer for in class any time soon.
Sure, I can help you with that. It seems like you want to write a function module and then convert it into an algorithm based on the given pseudocode. Here's how you can do it:
1. Writing the Function Module:
In most programming languages, you can create a function to encapsulate the logic. Assuming you are using a language like Python, you can write the function module like this:
```
def sumsquare():
count = 0
square = 1
sumsquare = 0
while count <= 2:
count = count + 1
sumsquare = sumsquare + square
return sumsquare
```
2. Converting the Function Module into an Algorithm:
To convert the function module into an algorithm, you can follow these steps:
Step 1: Initialize variables:
- count = 0
- square = 1
- sumsquare = 0
Step 2: Loop while count is less than or equal to 2:
- Increment count by 1
- Add square to sumsquare
Step 3: End the loop
Step 4: Return the value of sumsquare
The final algorithm would look like this:
```
count ← 0
square ← 1
sumsquare ← 0
WHILE count ≤ 2 DO
count ← count + 1
sumsquare ← sumsquare + square
END WHILE
RETURN sumsquare
```
Hope this helps! Let me know if you have any further questions.