Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Can you help me check the answer plz Translate question 1 to question 2 1) Writing an algorithm (20 marks] Complete the algorithm that outputs

Can you help me check the answer plz
image text in transcribed
image text in transcribed
Translate question 1 to question 2
1) Writing an algorithm (20 marks] Complete the algorithm that outputs the average value of all positive numbers found in a list. Assume that a positive number is a number greater than 0. For example: Given a list with the following contents: (8, -4, -1,7, 0, -3,4,-1, -6, -3, 6, 5, 11, -4, 0,5, 2] - The output should be 6, because (8+7+4+6+5+11+5+2)/8 = 6 Complete the algorithm given the following first steps: 1. Input items into list 2 index=0 3 Count-o 4. While index > count count+lisindex indexindex +1 count count 8 Output

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Securing SQL Server Protecting Your Database From Attackers

Authors: Denny Cherry

2nd Edition

1597499471, 978-1597499477

More Books

Students also viewed these Databases questions