Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Need these to be converted into ATOM IDE logic/grammar please and thank you #include using namespace std; int numbers[15]; int len; // function to get

Need these to be converted into ATOM IDE logic/grammar please and thank you

#include

using namespace std;

int numbers[15];

int len;

// function to get & store values

void getval(int num){

for(int i = 0;i < num;i++)

{

cin>>numbers[i];

}

}

//function to find average

int findMean() {

int total=0;

int Mean;

for(int i=0; i < len ;i++)

{

total = total + numbers[i];

}

Mean = total/len;

return Mean;

}

// function to find smallest value

int findsmallvalue()

{

if ( len > 0 ) {

int smallest = numbers[0]; //assume that first element is smallest

for ( int i = 1; i < len; i++ ) {

if ( smallest > numbers[i] ) {

smallest = numbers[i]; //update smallest

}

}

return smallest;

}

}

// function to find largest value

int findlargestvalue()

{

if ( len > 0 ) {

int largest = numbers[0]; //assume that first element is largest

for ( int i = 1; i < len; i++ ) {

if ( largest < numbers[i] ) {

largest = numbers[i]; //update smallest

}

}

return largest;

}

}

// main function

int main() {

cout << " Enter the number of values: ";

cin >> len;

cout << " The Enter the values:" ;

getval(len);

cout << " The Mean of entered values is : "<

cout << " The Smallest value in the array is : "<

cout << " The Largest value in the array is : " <

return 0;

}

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

More Books

Students also viewed these Databases questions