int sumw=0, sum1=0, count=0; double average=0.0, value, weight; 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” End End Set average = sum1/sumw; Print the average what is the python code?
Max Function
Statistical function is of many categories. One of them is a MAX function. The MAX function returns the largest value from the list of arguments passed to it. MAX function always ignores the empty cells when performing the calculation.
Power Function
A power function is a type of single-term function. Its definition states that it is a variable containing a base value raised to a constant value acting as an exponent. This variable may also have a coefficient. For instance, the area of a circle can be given as:
int sumw=0, sum1=0, count=0;
double average=0.0, value, weight;
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”
End
End
Set average = sum1/sumw;
Print the average
what is the python code?
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images