1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
olga55 [171]
4 years ago
12

Create a program named IntegerFacts whose Main() method declares an array of 10 integers.Call a method named FillArray to intera

ctively fill the array with any number of values up to 10 or until a sentinel value (999) is entered. If an entry is not an integer, reprompt the user.Call a second method named Statistics that accepts out parameters for the highest value in the array, lowest value in the array, sum of the values in the array, and arithmetic average.In the Main() method, display all the statistics in the following format: Note: The inputs were 1, 11, and 999The array has 2 valuesThe highest value is 11The lowest value is 1The sum of the values is 12The average is 6 using static System.Console;class IntegerFacts{ static void Main() { // Write your main here } public static int FillArray(int[] array) { } public static void Statistics(int[] array, int els, out int high, out int low, out int sum, out double avg) { } }

Engineering
1 answer:
musickatia [10]4 years ago
8 0

Answer:

C# codee

using System;

class IntegerFacts

{

static void Main()

{

int[] x = new int[10];

int sum = 0;

int siz = 0, high = 0, low = 0, avg = 0;

siz = FillArray(x);

Statistics(x, ref high, ref low, ref sum, ref avg, siz);

Console.Write("The highest value is " + high);

Console.Write("\nThe lowest value is " + low);

Console.Write("\nThe sum of the values is " + sum);

Console.Write("\nThe average is " + avg);

}

static void Statistics (int [] b, ref int h, ref int l, ref int s, ref int a, int size)

{

if (size == 0)

h = l = s = a = 0;

else

{

int i =0;

l = 999;

h = 0;

s = 0;

for (; i < size;++i)

{

if(b[i] > h)

h = b[i];

if(b[i] < l)

l = b[i];

s += b[i];

}

a = s / size;

}

}

static int FillArray (int[] a)

{

int i = 0, count = 0;

int intTemp =0 ;

string temp;

for(i = 0 ; i < 10 ; i++)

{

Console.Write("Enter element number"+(i+1) +" : ");

temp = Console.ReadLine();

if (int.TryParse(temp, out intTemp)) {

if (intTemp != 999)

{

a[i] = intTemp;

count++;

}

else

break;

}

else

{

Console.Write("\n\nOops.. You entered a wrong number. Try again \n\n");

i--;

}

}

return count;

}

}

Explanation:

The output of the above program is given in the attached file.

You might be interested in
The convection heat transfer coefficient for a clothed person standing in moving air is expressed as h 5 14.8V0.69 for 0.15 , V
dolphi86 [110]
Cychbjnivrxezyyihvhuytrruokjaa
5 0
3 years ago
Read 2 more answers
Is A fine by the EPA may be imposed on the employer or
goldfiish [28.3K]

Answer:

No false

Explanation:

8 0
3 years ago
Two advantages of deforming steel at room temperature rather than at elevated temperatures are: (select 2 answers from the optio
Aleks [24]

Answer:

A AND C

Explanation:

Two advantages of deforming steel at room temperature rather than at elevated temperatures are: (select 2 answers from the options below)

A. better dimensional accuracy to allow form complex parts with complex geometries.

C. a smoother surface finish to allow elimination of finish machining and grinding operations.

7 0
3 years ago
Write down the equation for the stoichiometric combustion of propane (C3H8).
zimovet [89]
(36 + 8)44 g c3h8/1mol
8 0
4 years ago
Determine the nature of the following cycle (reversible, irreversible, or impossible): a refrigeration cycle draws heat from a c
vlabodo [156]

Answer:

Impossible.

Explanation:

The ideal Coefficient of Performance is:

COP_{i} = \frac{250\,K}{300\,K-250\,K}

COP_{i} = 5

The real Coefficient of Performance is:

COP_{r} = \frac{950\,kJ-70\,kJ}{70\,kJ}

COP_{r} = 12.571

Which leads to an absurds, since the real Coefficient of Performance must be equal to or lesser than ideal Coefficient of Performance. Then, the cycle is impossible, since it violates the Second Law of Thermodynamics.

6 0
4 years ago
Other questions:
  • A higher grade number for oil means it is _____.
    6·2 answers
  • What is the entropy of a closed system in which 25 distinguishable grains of sand are distributed among 1000 distinguishable equ
    5·2 answers
  • You are watching the weather forecast and the weatherman says that strong thunderstorms and possible tornadoes are likely to for
    15·1 answer
  • A dry sample of sand is placed in a container having a volume of 0.3 ft3. The dry weight of the sample is 31 lb. Water is carefu
    14·1 answer
  • A hair dryer is basically a duct of constant diameter in which a few layers of electric resistors are placed. A small fan pulls
    7·1 answer
  • Airbags will deploy in a head on collision but not in a collision that occurs from angle
    13·1 answer
  • Knowing that the central portion of the link BD has a uniform cross-sectional area of 800 2, determine the magnitude of the load
    8·1 answer
  • ¿Cómo se puede identificar los requerimientos de Posición y Orientación de los elementos de un sistema robótico?
    9·1 answer
  • a television set having apower rating of 120w and electric lawnmower of power rating 1kw are both connected to a 250v supply if
    14·1 answer
  • What do we need to do to get CO2 emissions all the way to zero?
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!