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 long corridor has a single light bulb and two doors with light switch at each door.
Tpy6a [65]

Answer:

  Light = A xor B

Explanation:

If switches A and B produce True or False, then Light will be True for ...

  Light = A xor B

8 0
3 years ago
Using the Rayleigh criterion, calculate the minimum feature size that can be resolved in a system with a 0.18 NA lens when g-lin
Vladimir79 [104]

Answer:

a)

# for a g line, R = 1.211 μm

# for an I-line, R = 1.013 μm

b)

# for a g line, R = 0.726 μm

# for an I-line, R = 0.243 μm

c)

# for a g line, R = 0.605 μm

# for an I-line, R = 0.608 μm

Explanation:

We know that;

Rayleigh Resolution R = 0.5 × λ/NA

for a g line, λ = 436 nm

for an I-line λ = 365 nm

a)

Now when NA = 0.18

# for a g line, λ = 436 nm

R = 0.5 × 436/0.18 =  1.211 μm

# for an I-line λ = 365 nm

R = 0.5 × 365/0.18 =  1.013 μm

b)

when NA = 0.30

# for a g line, λ = 436 nm

R = 0.5 × 436/0.30 =  0.726 μm

# for an I-line λ = 365 nm

R = 0.5 × 365/0.30 =  0.243 μm

c)

when NA = 0.36

# for a g line, λ = 436 nm

R = 0.5 × 436/0.36 =  0.605 μm

# for an I-line λ = 365 nm

R = 0.5 × 365/0.30 =  0.608 μm

6 0
3 years ago
A stomp rocket is a toy consisting of a hose connected to a blast pad (i.e., an air bladder) at one end and to a short pipe moun
lesya [120]

Answer:

Explanation:

The detailed steps is as shown in the attachment.

8 0
3 years ago
Express the following quantities to the nearest standard prefix using no more than three digits.(a) 20,000,000 Hz(b) 1025 W(c) 0
bija089 [108]

Answer:

(a) 20 MHz

(b) 1.025 KW

(c) 3.33 ns

(d) 33 pF

Explanation:

(a) 20,000,000 Hz = 20 x 10^6 Hz = 20 Mega Hz = <u>20 MHz</u>

(b) 1025 W = 1.025 x 10^3 W = 1.025 Kilo W = <u>1.025 KW</u>

(c) 0.333 x 10^(-8) s = 3.33 x 10^(-9) s = 3.33 nano s = <u>3.33 ns</u>

(d) 33 x10^(-12)F = 33 pico F = <u>33 pF</u>

8 0
3 years ago
stimate the maximum efficiency of an automobile engine that has a compression ratio of 5:1.0. Assume the engine operates accordi
Fed [463]

Answer:

Efficiency based on Otto cycle.

Effotto = 47.47%

Explanation:

Efficiency based on Otto cycle.

effotto = 1 – (V2 / V1)^γ-1

effotto = 1 – (1 / 5)^1.4 - 1

effotto = 47.47%

5 0
3 years ago
Other questions:
  • if you had 100 B size sheets and you cut them into A size sheets, how many sheets of A size paper would you have
    14·1 answer
  • Determine the average power, complex power and power factor (including whether it is leading or lagging) for a load circuit whos
    9·2 answers
  • Uber drivers are considered 'independent contractors' and thus can apply for business licenses.
    11·2 answers
  • 4.68 Steam enters a turbine in a vapor power plant operating at steady state at 560°C, 80 bar, and exits as a saturated vapor at
    15·1 answer
  • For two different air velocities, the Nusselt number for two different diameter cylinders in cross flow is the same. The average
    6·1 answer
  • Explain what the engineering team should advise in the following scenario.
    7·1 answer
  • What is photosynthesis​
    9·2 answers
  • Hello, I have a question, I would be glad if you can help.
    5·1 answer
  • A ________ can be installed in a cast-iron block to repair a worn or cracked cylinder. Question 24 options:
    10·1 answer
  • You may wonder who the rest goes
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!