Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hi, I need to translate this program to C++ program. REM Basic Example Program REM Input: An integer, listlen, where listlen is less REM than

Hi, I need to translate this program to C++ program.

REM Basic Example Program REM Input: An integer, listlen, where listlen is less REM than 100, followed by listlen-integer values REM Output: The number of input values that are greater REM than the average of all input values DIM intlist(99) result = 0 sum = 0 INPUT listlen IF listlen > 0 AND listlen < 100 THEN REM Read input into an array and compute the sum FOR counter = 1 TO listlen INPUT intlist(counter) sum = sum + intlist(counter) NEXT counter REM Compute the average average = sum / listlen REM Count the number of input values that are > average FOR counter = 1 TO listlen IF intlist(counter) > average THEN result = result + 1 NEXT counter REM Print the result PRINT "The number of values that are > average is:"; result ELSE PRINT "Error-input list length is not legal" END IF END

Based on your opinion do you agree that it was easy to understand, implement and test?

THank you,

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

Database Security XI Status And Prospects

Authors: T.Y. Lin, Shelly Qian

1st Edition

0412820900, 978-0412820908

More Books

Students also viewed these Databases questions

Question

I need activity digram for Jenni.ai website

Answered: 1 week ago