Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need to know how to input the following into a compiler for a C++ code. It is the questions from chapter 6 #2 a

I need to know how to input the following into a compiler for a C++ code.

It is the questions from chapter 6 #2 a & b

// Start

// Declarations

// num SIZE = 12

// num numbers[SIZE]

// num value = 0

// num counter = 0

// num total = 0

// num average = 0

// num diffFromAvg = 0

// num SENTINEL = -1

//

// output "Please enter a positive number: "

// input value

// while ((counter < SIZE) AND (value <> SENTINEL) )

// total = total + value

// numbers[counter] = value

// counter = counter + 1

// if (counter <> SIZE)

// output "Please enter a positive number: "

// input value

// endif

// endwhile

//

// if (counter > 0) then

// average = total/counter

// for i = 0 to counter - 1

// diffFromAvg = numbers[i] - average

// output "Number[",i,"]: ",numbers[i]," Difference from Average is ",diffFromAvg

// endfor

// else

// output "Processing incomplete. No values in the array."

// endif

// Stop

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

Modern Database Management

Authors: Fred R. McFadden, Jeffrey Slater, Mary B. Prescott

5th Edition

0805360549, 978-0805360547

More Books

Students also viewed these Databases questions

Question

LO5 Highlight five external recruiting sources.

Answered: 1 week ago