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
If the stopping sight distance required to avoid colliding with a fallen boulder on a mountain pass is 800 feet, what is the lik
Anettt [7]

Answer:

Grade is 10.32%

Explanation:

Given data:

stopping side distance is 800ft

t = 2.5 sec

design speed v = 65 miles/hr

a/g value is 0.35

stopping side distance is SSD

SSD = 1.47 vt + \frac{v^2}{30(a/g - G}

plugging all value for G

800 = 1.47 \times 65\times 2.4 + \frac{65^2}{30(0.35 -G)}

800 - 229.32 = \frac{65^2}{30(0.35 -G)}

570.68 = \frac{65^2}{30(0.35 -G)}

G = 0.1032

Grade is 10.32%

5 0
4 years ago
If, for a particular junction, the acceptor concentration is 1017/cm3 and the donor concentration is 1016/cm3 , find the junctio
natima [27]

Answer:

<u>note: </u>

<u><em>solution is attached in word form due to error in mathematical equation. furthermore i also attach Screenshot of solution in word due to different version of MS Office please find the attachment </em></u>

Download docx
8 0
4 years ago
Liệt kê 10 quá trình sản xuất công nghiệp có sử dụng chất xúc tác
Flauer [41]

answer in the screenshot

8 0
2 years ago
A power cycle receives QH by heat transfer from a hot reservoir at TH = 1200 K and rejects energy QC by heat transfer to a cold
PIT_PIT [208]

Answer:

a) Irreversible, b) Reversible, c) Irreversible, d) Impossible.

Explanation:

Maximum theoretical efficiency for a power cycle (\eta_{r}), no unit, is modelled after the Carnot Cycle, which represents a reversible thermodynamic process:

\eta_{r} = \left(1-\frac{T_{C}}{T_{H}} \right)\times 100\,\% (1)

Where:

T_{C} - Temperature of the cold reservoir, in Kelvin.

T_{H} - Temperature of the hot reservoir, in Kelvin.

The maximum theoretical efficiency associated with this power cycle is: (T_{C} = 400\,K, T_{H} = 1200\,K)

\eta_{r} = \left(1-\frac{400\,K}{1200\,K} \right)\times 100\,\%

\eta_{r} = 66.667\,\%

In exchange, real efficiency for a power cycle (\eta), no unit, is defined by this expression:

\eta = \left(1-\frac{Q_{C}}{Q_{H}}\right) \times 100\,\% = \left(\frac{W_{C}}{Q_{H}} \right)\times 100\,\% = \left(\frac{W_{C}}{Q_{C} + W_{C}} \right)\times 100\,\% (2)

Where:

Q_{C} - Heat released to cold reservoir, in kilojoules.

Q_{H} - Heat gained from hot reservoir, in kilojoules.

W_{C} - Power generated within power cycle, in kilojoules.

A power cycle operates irreversibly for \eta < \eta_{r}, reversibily for \eta = \eta_{r} and it is impossible for \eta > \eta_{r}.

Now we proceed to solve for each case:

a) Q_{H} = 900\,kJ, W_{C} = 450\,kJ

\eta = \left(\frac{450\,kJ}{900\,kJ} \right)\times 100\,\%

\eta = 50\,\%

Since \eta < \eta_{r}, the power cycle operates irreversibly.

b) Q_{H} = 900\,kJ, Q_{C} = 300\,kJ

\eta = \left(1-\frac{300\,kJ}{900\,kJ} \right)\times 100\,\%

\eta = 66.667\,\%

Since \eta = \eta_{r}, the power cycle operates reversibly.

c) W_{C} = 600\,kJ, Q_{C} = 400\,kJ

\eta = \left(\frac{600\,kJ}{600\,kJ + 400\,kJ} \right)\times 100\,\%

\eta = 60\,\%

Since \eta < \eta_{r}, the power cycle operates irreversibly.

d) Since \eta >  \eta_{r}, the power cycle is impossible.

8 0
3 years ago
Explain the 3 examples of technology transfer
xxTIMURxx [149]

Answer:

ht f of tevno animation de espain ingleis

8 0
4 years ago
Other questions:
  • Consider the following fragment of code in an authentication program:
    9·1 answer
  • A negative pressure respirator brings fresh air to you through a hose<br>A) True<br>B)False​
    15·2 answers
  • A helical compression spring is made with oil-tempered wire with wire diameter of 0.2 in, mean coil diameter of 2 in, a total of
    7·1 answer
  • A pin fin of uniform cross-sectional area is fabricated of an aluminum alloy (k = 160W m-1 K-1 ). The fin diameter is D = 4 mm,
    15·1 answer
  • A non-inductive load takes a current of 15A at 125V. An inductor is then connected in series in order that the same current shal
    10·1 answer
  • Please help me with this. Picture
    10·1 answer
  • A glass tube is inserted into a flowing stream of water with one opening directed upstream and the other end vertical. If the wa
    9·1 answer
  • How do i do this? if y’all don’t mind helping lol
    13·1 answer
  • What is the relationship between compressor work and COPR?
    14·1 answer
  • Chemical engineers determine how to transport chemicals.<br> O True<br> False
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!