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
Which of the following are examples of mutually exclusive events? Group of answer choices
kap26 [50]

Answer:

The correct is answer is <u>All of these</u> because:

  • walking and running at the same time
  • rain and a cloudless sky
  • snow and a temperature of 10° Celsius

are all mutually exclusive events.

Explanation:

walking and running at the same time :

Humans can multi task and engage the brain in coordinating psycho motor, affective and cognitive processes all at once but in the case of activities such as running and walking, it is impossible because, the same organs, neurons and muscles are needed for both activity.  

Rain and a cloudless sky :

Rain occurs after a process of condensation. When the vapor that rises, cools off and form a cloud. Rain happens when the cloud formed dissolves. In other words, rain is clouds in liquid state and there is definitely no rain without a cloud.

Snow and a temperature of 10° Celsius:

Snow is synonymous with extreme cold temperatures usually below 0° Celsius. When it snows, temperature levels ranges from zero degrees to -10° Celsius. Therefore, a temperature of 10° Celsius can never occur when it is snowing.

7 0
3 years ago
Read 2 more answers
The manufacturer of a 1.5 V D flashlight battery says that the battery will deliver 9 mA for 40 continuous hours. During that ti
Jet001 [13]

Answer:

a) 144.000 s

b) and c)Battery voltage and power plots in attached image.

   V=-\frac{0.5}{144000} t + 1.5 V[tex]    [tex]P(t)=-(31.25X10^{-9}) t+0.0135  where D:{0<t<40} h

d) 1620 J

Explanation:  

a) The first answer is a rule of three

s=\frac{3600s * 40h}{1h} = 144000s

b) Using the line equation with initial point (0 seconds, 1.5 V)

m=\frac{1-1.5}{144000-0} = \frac{-0.5}{144000}

where m is the slope.

V-V_{1}=m(x-x_{1})

where V is voltage in V, and t is time in seconds

V=m(t-t_{1}) + V_{1} and using P and m.

V=-\frac{0.5}{144000} t + 1.5 V[tex] c) Using the equation VPOWER IS DEFINED AS:[tex] P(t) = v(t) * i(t) [tex]so.[tex] P(t) = 9mA * (-\frac{0.5}{144000} t + 1.5) [tex][tex]P(t) = - (31.25X10^{-9}) t + 0.0135

d) Having a count that.

E = \int\limits^{144000}_{0} {P(t)} \, dt  = \int\limits^{144000}_{0} {v(t)*i(t)} \, dt

E = \int\limits^{144000}_{0} {-\frac{0.5}{144000} t + 1.5*0.009} \, dt = 1620 J

4 0
3 years ago
a. Replacing standard incandescent lightbulbs with energy-efficient compact fluorescent lightbulbs can save a lot of energy. Cal
monitta

Answer:

a) 1512000 Joules

b) 5040 seconds = 84 minutes = 1.4 hours

Explanation:

a) Power saved by replacing bulbs = 60-18 = 42 W = 42 J/s

Time the bulb is used for = 10 hours

Energy saved during this time

42×10×60×60 = 1512000 Joules

Saved energy by replacing standard incandescent lightbulbs with energy-efficient compact fluorescent lightbulbs in 10 hours is 1512000 Joules

b) Power the plasma TV uses = 300 W = J/s

\frac{1512000}{300}=5040\ s

Time a plasma TV can be used for with the saved energy is 5040 seconds = 84 minutes = 1.4 hours.

4 0
3 years ago
“In a List of Positive Integers, Set MINIMUM to 1. For each number X in the list L, compare it to MINIMUM. If X is smaller, set
artcher [175]

Answer:

no i cant answer it sorry

7 0
3 years ago
No matter how many employees you have, the fire prevention plan needs to be in writing. True or False?
Marta_Voda [28]

Answer:

True

Explanation:

3 0
2 years ago
Read 2 more answers
Other questions:
  • A network address of 172.16.0.0 /12 has been given. Which of the following accurately describes this network? (select one or mor
    9·1 answer
  • A metal plate of 400 mm in length, 200mm in width and 30 mm in depth is to be machined by orthogonal cutting using a tool of wid
    12·2 answers
  • What does a peak flow meter allow you to assess?
    6·1 answer
  • Technician A says that latent heat is hidden heat and cannot be measured on a thermometer. Technician B says that latent heat is
    12·1 answer
  • Air-conditioning principles are being discussed. Technician A states that heat always
    13·1 answer
  • I need help plz <br><br> Drag each label to the correct location on the image.
    11·1 answer
  • Air enters a control volume operating at steady state at 1.2 bar, 300K, and leaves at 12 bar, 440K, witha volumetric flow rate o
    11·1 answer
  • Why can the human powered generator be the worst option for the rescue team
    10·1 answer
  • Which wing shape controls lift and drag?
    13·1 answer
  • Simple Gear Train With Idler Gear Mechanism ASAP WILL GIVE BRAINLEIST
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!