Partial Pseudocode for Project #3 – Compute the Weighted Average Pseudocode for functions is missing, however the logic needed to complete the assignment is below without functions. It should be used in conjunction with the requirements for Project #3. Initialize/declare variables While count < 5 Input value Input weight If weight is greater than or equal than zero then Set sumw = sumw + weight Set sum1 = sum1 + value * weight Increment the counter by 1 Else Print “Weight you entered must be a positive number” Calculate the average Print the average
Partial Pseudocode for Project #3 – Compute the Weighted Average
Pseudocode for functions is missing, however the logic needed to complete the assignment is below without functions. It should be used in conjunction with the requirements for Project #3.
Initialize/declare variables
While count < 5
Input value
Input weight
If weight is greater than or equal than zero then
Set sumw = sumw + weight
Set sum1 = sum1 + value * weight
Increment the counter by 1
Else
Print “Weight you entered must be a positive number”
Calculate the average
Print the average
Trending now
This is a popular solution!
Step by step
Solved in 2 steps