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]
3 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]3 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
As the impurity concentration in solid solution of a metal is increased, the tensile strength:________.a) decreasesb) increasesc
valkas [14]

Answer:

Increases

Explanation:

By inhibiting the motion of dislocations by impurities in a solid solutions, is a strengthening mechanism. In solid solutions it is atomic level strengthening resulting from resistance to dislocation motion. Hence, the strength of the alloys can differ with respect to the precipitate's property. Example, the precipitate is stronger (ability to an obstacle to the dislocation motion) than the matrix and it shows an improvement of strength.

5 0
3 years ago
Air is contained in a vertical piston–cylinder assembly such that the piston is in static equilibrium. The atmosphere exerts a p
oee [108]

Answer:

a) 24 kg

b) 32 kg

Explanation:

The gauge pressure is of the gas is equal to the weight of the piston divided by its area:

p = P / A

p = m * g / (π/4 * d^2)

Rearranging

p * (π/4 * d^2) = m * g

m = p * (π/4 * d^2) / g

m = 1200 * (π/4 * 0.5^2) / 9.81 = 24 kg

After the weight is added the gauge pressure is 2.8kPa

The mass of piston plus addded weight is

m2 = 2800 * (π/4 * 0.5^2) / 9.81 = 56 kg

56 - 24 = 32 kg

The mass of the added weight is 32 kg.

5 0
3 years ago
I need a thesis statement about Engineers as Leaders.
algol [13]

Answer:

Engineers are a very beneficial contribution in which offers great solutions to national problems.

5 0
3 years ago
Consider this example of a recurrence relation. A police officer needs to patrol a gated community. He would like to enter the g
SashulF [63]

Answer:

the police officer cruise each streets precisely once and he enters and exit with the same gate.

Explanation:

NB: kindly check below for the attached picture.

The term ''Euler circuit'' can simply be defined as the graph that shows the edge of K once in a finite way by starting and putting a stop to it at the same vertex.

The term "Hamiltonian Circuit" is also known as the Hamiltonian cycle which is all about a one time visit to the vertex.

Here in this question, the door is the vertex and the road is the edge.

The information needed to detemine a Euler circuit and a Hamilton circuit is;

"the police officer cruise each streets precisely once and he enters and exit with the same gate."

Check attachment for each type of circuit and the differences.

7 0
3 years ago
50 points what shape is mars
Artyom0805 [142]
A sphere.............
5 0
2 years ago
Read 2 more answers
Other questions:
  • A large spherical tank contains gas at a pressure of 400 psi. The tank is constructed of high-strength steel having a yield stre
    15·1 answer
  • Most licensed architects are members of which association?
    13·2 answers
  • Will this airplane stay in the air a long time? Why or why not?
    9·1 answer
  • How does flextape adhere under water?​
    8·1 answer
  • Wiring harnesses run
    12·1 answer
  • Effective presentations are: Have a central message Colorful and exciting Have many messages Are influence by a setting Created
    15·2 answers
  • 1. What's the maximum overall length of the part?<br> 2. What material is used to fabricate the part
    5·1 answer
  • Solve the inequality below.Use the drop-down menus to describe the solution and its graph.
    12·1 answer
  • A 1/20 scale model of a wing is used to determine forces on the actual airplane. the 1/20 scale refers to the:_____
    10·2 answers
  • John has an exhaust leak in his Acura Integra GS-R, What steps would he take to fix the leak in time for his inspection?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!