need python and pseudo code thank you Analysis Phase for Project #3.doc NOTE: Execute Project#3
Question:
need python and pseudo code
thank you
Analysis Phase for Project #3.doc NOTE: Execute Project#3
Test Case #6 (see project #3) requirements for the six test cases
Numbers below to be input from the user via the keyboard
Value: 85 88 93 87 96
Weights: 10 10 20 30 30
Calculation below
Input Running totals counter
Value Weights Sumw Sum1 Count
85 10 0 0 0
88 10 10 850 1
93 20 40 1,730 2
87 30 70 3,590 3
90 30 100 6,200 4
9,080 5
Test Data for TEST CASE #6 The logic belows follows the pseudocode
85 10 88 10 93 20 87 30 96 30
10 10 10 10 20 20 30 30 30 30
+0 *85 +10 *88 +20 *93 +40 *87 +40 *96
10 850 20 880 40 1860 70 2,610 100 2880
+1,730 +1730 +3,590 +6200
3,590 6,200 9,080
Overview
This project allows you to followand experiment withthe critical stepsof developing a program including the programdescription, analysis, testplan, design (usingpseudocode of which you must create),and implementation with Python code. The program provided uses sequential, selection
Program Description
This program will calculate the weighted average of 5 numbers. The program will ask the user to enter 5 numbers treated as weights and 5 numbers to be averaged. The program will use a loop to input the data.
NOTE: You donot have to use the variable and function names below. I recommend you use your own variable names and function names.
You will use sequential, selection and repetition programming statements.
You will define one integer number: count
count will storehow many times valid weightsand values have been entered.
You will definea variety of doubles: weight,value, sum, sumw,avg value will store the input value
weight will store the input weight for that value
sum will store the running sum of values and weights sumw will store the running of the weights
avg willstore theweighted average of the 5 numbers and 5 weights input.
The running sum will be calculated by this formula: sum = sum + value * weight
For example, if the first value and weight pair entered is 4, 1 and secondpair is10, 3: sum = sum + value*weight = 0 + 4*1
sum = 4 + 10*3 = 34 sumw = 1 + 3 = 4
Values and sum are to be input and calculated within a repetition loop:
while count < 5 Input value, weight
sumw = sumw + weight
sum = sum + value * weight
count = count + 1
End while
Avg is calculated by:
avg = sum / sumw
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill