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
A cold storage room is used to keep the temperature inside the room maintain at low temperature.
lianna [129]

Answer:

The power of the brick wall it may be how the soiled ness of the wall too keep in the cold

Explanation:

5 0
3 years ago
Read 2 more answers
You were hoping to receive a scholarship for volleyball and are entering your personal information and statistics on a secure we
kozerog [31]
I think it is fair to say 5 and 3/4 inches.
6 0
3 years ago
Read 2 more answers
2. How many amperes of current will flow through a circuit that has 3 ohms of resistance if
Dmitriy789 [7]

Answer:

4A

Explanation:

From Ohms law ;

R= V/I where R is resistance, V is voltage and I is current

Given that;

R= 3Ω

V= 12

Using the values in the formula as;

R= V/I

3=12/I

I= 12/3

I= 4 A

4 0
3 years ago
In wet mill ethanol plants, a total energy of 74,488 Btu (British thermal units, a common energy unit) is used to produce 1 gall
V125BC [204]

Answer:

The energy yield for one gallon of ethanol is 2.473 %.

Explanation:

The net energy yield (\% e), expressed in percentage for one gallon of ethanol is the percentage of the ratio of the difference of the provided energy (E_{g}), measured in Btu, and the energy needed to produce the ethanol (E_{p}), measured in Btu, divided by the energy needed to produce the ethanol. That is:

\% e =\frac{E_{g}-E_{p}}{E_{p}} \times 100\,\% (1)

If we know that E_{g} = 76330\,Btu and E_{p} = 74488\,Btu, then the net energy yield of 1 gallon of ethanol:

\%e = \frac{76330\,Btu-74488\,Btu}{74488\,Btu}\times 100\,\%

\%e = 2.473\,\%

The energy yield for one gallon of ethanol is 2.473 %.

4 0
3 years ago
A heating system must maintain the interior of a building at 20°C during a period when the outside air temperature is 5°C and th
Anettt [7]

Answer:

a. W = 51,194.54 kJ

b. W = 102,390 kJ

c. W = 153,585 kJ

Explanation:

(COP)_{HP} =\frac{Desired-effectx}{Work-done}= \frac{Q_{1} }{W} \\\\(COP)_{HP} =(COP)_{Ideal}\\\\\frac{Q1}{W} =\frac{T_{1} }{T_{1} -T_{2} }

W=Q_{1} \frac{T_{1}-T_{2}  }{T_{1} }

a. the ground at 15°C.

T_{1}=20°C = 273 K + 20 = 293 K

T_{2}=15°C = 273 K + 15 = 288 K

Q_{1}=3x10^{6} kJ

W=3x10^{6} kJ \frac{293 K-288 K}{293 K}=3x10^{6} kJ \frac{5 K}{293 K}=3x10^{6} kJ x 0.017065}

W = 0.051195x10^{6} kJ

W = 51,194.54 kJ

b. a pond at 10°C.

T_{2}=10°C = 273 K + 10 = 283 K

W=3x10^{6} kJ \frac{293 K-283 K}{293 K}=3x10^{6} kJ \frac{10 K}{293 K}=3x10^{6} kJ x 0.034130}

W = 0.102390x10^{6} kJ

W = 102,390 kJ

c. the outside air at 5°C.

T_{2}=5°C = 273 K + 5 = 278 K

W=3x10^{6} kJ \frac{293 K-278 K}{293 K}=3x10^{6} kJ \frac{15 K}{293 K}=3x10^{6} kJ x 0.051195}

W = 0.153585x10^{6} kJ

W = 153,585 kJ

Hope this helps!

3 0
3 years ago
Other questions:
  • What are the challenges posed by strategic information systems, and how should they be addressed?
    10·1 answer
  • A high molecular weight hydrocarbon gas A is fed continuously into a heated mixed flow reactor (0.1liter) where it is thermally
    6·1 answer
  • A study of online dating found that when including emoticons in their profiles, response rates for female users _______ by _____
    15·1 answer
  • The ???? − i relationship for an electromagnetic system is given by ???? = 1.2i1/2 g where g is the air-gap length. For current
    6·1 answer
  • Air, at a free-stream temperature of 27.0°C and a pressure of 1.00 atm, flows over the top surface of a flat plate in parallel f
    13·1 answer
  • Energy.
    10·1 answer
  • How much does 1 gallon of water weigh in pound given that the density of water is 1gram/ cm3
    5·1 answer
  • What is the relationship of waste management and bioremediation?
    8·2 answers
  • The W16x50, steel beam below has a span of 26' and is subjected to a 2.3 k/ft uniform distributed loading. If a 8 kip load is al
    8·1 answer
  • Liquefied Natural Gas (LNG) is a natural gas in its liquid form that is clear, colorless, odorless, non-corrosive, and non-toxic
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!