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
Piping layout carrying liquid water at 70°F at a volumetric flow rate of 0.2 is composed of four sections of 4-in. Diameter stee
horrorfan [7]

Answer:I have no clue if you find out let me know

Explanation:

7 0
3 years ago
Ma puteti ajuta cu un argument de 2 pagini despre inlocuirea garniturii de etansare de pe pistonul etrierului de franare la un a
Nitella [24]

Answer:

can you translate

Explanation:

what Is that?

4 0
3 years ago
A satellite at a distance of 36,000 km from an earth station radiates a power of 10 W from an
notsponge [240]
This an example solved please follow up with they photo I sent ok

4 0
3 years ago
The Hoover Dam is 221 m tall and 379 m wide. Approximating it as a flat plate, determine the effective resultant force on the da
IrinaVladis [17]

Answer:

2165800 Pa

Explanation:

See it in the pic.

3 0
3 years ago
A contractor is planning on including several skylights in each unit of a residential development. What type of worker would she
Sladkaya [172]

Answer:

Glazier

Explanation:

Glaziers are workers who specializes in cutting and installation of glass works.

They work with glass in various surfaces and settings, such as cutting and installing windows and doors, skylights, storefronts, display cases, mirrors, facades, interior walls, etc.

Thus, the type of worker the contractor will hire for this project is a Glazier

8 0
3 years ago
Other questions:
  • How do Solar Engineers Help Humans?<br> (2 or more sentences please)
    9·1 answer
  • Suppose you are implementing a relational employee database, where the database is a list of tuples formed by the names, the pho
    14·1 answer
  • Determine the Thevenin/Norton Equivalent Circuit with respect to the terminalsa,bas shown in the figure. (Here 1A is an independ
    11·1 answer
  • A soil has the following Green-Ampt parameters Effective porosity 0.400 Initial volumetric moisture content-15% Hydraulic Conduc
    6·1 answer
  • Do heavier cars really use more gasoline? Suppose a car is chosen at random. Let x be the weight of the car (in hundreds of poun
    9·1 answer
  • In the SI system of units, the absolute temperature is measured to be 303 K Its value in Fahrenheit is a-) 76 F b)- 86F c)-79 F
    9·1 answer
  • A plane wall of thickness 2L = 40 mm and thermal conductivity k = 5 W/m K experiences uniform volumetric heat generation at a ra
    15·1 answer
  • Corrections for curvature and refraction (c r) are applied to: ____________.
    8·1 answer
  • In order to lift a lighter object on the other side, a boy placed 155 N of
    6·1 answer
  • Which of the following is an example of a pulley?
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!