Question
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started