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
**Please Help. ASAP**
natima [27]

Answer:

The answer is below

Explanation:

1)

\frac{v-u}{a} =t\\\\Making \ v\ the \ subject\ of\ formula:\\\\First \ cross-multiply:\\\\v-u=at\\\\add\ u\ to \ both\ sides:\\\\v-u+u=at+u\\\\v=u+at

2)

\frac{y-x^2}{x}=3z\\ \\Making\ y\ the\ subject\ of\ formula:\\\\First \ cross \ multiply:\\\\y-x^2=3xz\\\\y=3xz+x^2\\\\y=x(x+3z)

3)

x+xy=y\\\\Making\ x\ the\ subject\ of\ formula:\\\\x(1+y)=y\\\\Divide\ through\ by\ 1+y\\\\\frac{x(1+y)}{1+y} =\frac{y}{1+y} \\\\x=\frac{y}{1+y}

4)

x+y=xy\\\\Making\ x\ the\ subject\ of\ formula:\\\\Subtract\ x\ from \ both\ sides:\\\\x+y-x=xy-x\\\\y=xy-x\\\\y=x(y-1)\\\\Divide\ through\ by \ y-1\\\\\frac{y}{y-1} =\frac{x(y-1)}{y-1}\\ \\x=\frac{y}{y-1}

5)

x=y+xy\\\\Making\ x\ the\ subject\ of\ formula:\\\\Subtract\ xy\ from \ both\ sides:\\\\x-xy=y+xy-xy\\\\x-xy=y\\\\x(1-y)=y\\\\Divide\ through\ by \ 1-y\\\\\frac{x(1-y)}{1-y} =\frac{y}{1-y}\\ \\x=\frac{y}{1-y}

6)

E=\frac{1}{2}mv^2-\frac{1}{2}mu^2\\  \\Making\ u\ the\ subject \ of\ formula:\\\\Multiply \ through\ by \ 2\\\\2E=mv^2-mu^2\\\\mu^2=mv^2-2E\\\\Divide\ through\ by\ m:\\\\u^2=\frac{mv^2-2E}{m}\\ \\Take\ square\ root\ of \ both\ sides:\\\\u=\sqrt{\frac{mv^2-2E}{m}}

7)

\frac{x^2}{a^2}-\frac{y^2}{b^2}=1\\  \\Making\ y\ the\ subject \ of\ formula:\\\\\frac{x^2}{a^2}-1=\frac{y^2}{b^2}\\\\Multiply\ through\ by\ b^2\\\\b^2(\frac{x^2}{a^2} -1)=y^2\\\\Take\ square\ root\ of\ both\ sides:\\\\y=\sqrt{b^2(\frac{x^2}{a^2} -1)}

8)

ay^2=x^3\\\\Make\ y\ the\ subject\ of\ formula:\\\\Divide\ through\ by\ a:\\\\y^2=\frac{x^3}{a}\\ \\Take\ square\ root\ of\ both\ sides:\\\\y=\sqrt{\frac{x^3}{a}} \\

4 0
3 years ago
Which of these is not a type of socket
kotegsom [21]
You didn’t put a picture
7 0
3 years ago
Air flows from a large reservoir in which the pressure and temperature are 1 MPa and 30°C, respectively, through a convergent–di
SSSSS [86.1K]

Answer:

The solution is attached in the attachment.

3 0
2 years ago
Read 2 more answers
Explain The Basic Difference Between Bs2 And Bs3 Engine.​
snow_tiger [21]

Answer:

The main difference between the bs2 and bs3 engine is to present in the catalytic converter. And in bs2 engines the catalytic converter is does not used for the formation of hc and co. In bs3 engine there is no harmful emissions in the hc and co

3 0
2 years ago
soccer is also called association football" A soccer ball is a sphere, with circumference of 70 centimeters. in developing a new
timama [110]

Answer: Weight on Mars = 0.02593N

Explanation:

Given; Circumference C of Sphere = 70cm = 0.7m,

Specific Gravity S. G. of material = 1.21,

acceleration due to gravity in the Mars gm = 3.7m/s^2

We know that Weight W = mass m × acceleration due to gravity.

Let the Weight in on the Mars be Wm.

Wm = m × gm

Since we are given gm, we need to calculate for m. (Note that mass m is the same everywhere)

But mass = specific gravity × volume

Since we know the specific gravity, let's go ahead to calculate for the volume of the ball.

We know that Volume of a Sphere V = (4/3)πr^3

To get r, we know that C = 2πr

Therefore, r = C/(2π) = 0.7/(2π) = (7/10)/2π = 7/20π (in meters)

V = (4/3)*π×(7/20π)^3 = 343/6000π^2 (in meter^3)

m = 343/6000π^2 × 1.21 = 7.01×10^(-3)kg

Wm = 7.01×10^(-3) × 3.7 = 0.02593N

8 0
3 years ago
Other questions:
  • Name two types of Transformers.
    6·1 answer
  • Provide an argument justifying the following claim: The average (as defined here) of two Java ints i and j is representable as a
    9·1 answer
  • Pumped-storage hydroelectricity is a type of hydroelectric energy storage used by electric power systems for load balancing. The
    8·1 answer
  • Determine the average and rms values for the function, y(t)=25+10sino it over the time periods (a) 0 to 0.1 sec and (b) 0 to 1/3
    9·1 answer
  • A car is stopped at an entrance ramp to a freeway; its driver is preparing to merge. At a certain moment while stopped, this dri
    10·1 answer
  • A three-point bending test is performed on a glass specimen having a rectangular cross section of height d = 5.4 mm (0.21 in.) a
    6·1 answer
  • Discuss the organizational system that you believe would be the most effective for the safety officer in a medium-sized (100-200
    7·1 answer
  • You should use the pass technique a fire extinguisher
    8·1 answer
  • 9. Imagine that you're performing measurements on a circuit with a multimeter. You measure a total circuit
    14·2 answers
  • Which pipe for water is best for construction?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!