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
Design a PI controller to improve the steady-state error. The system should operate with a damping ratio of 0.8. Compute the ove
blondinia [14]

Answer:

The MATLAB Code for this PI Controller will be:

Kp = 350;

Ki = 300;

Kd = 50;

C = pid(Kp,Ki,Kd)

T = feedback(C*P,1);

t = 0:0.01:2;

step(T,t)

Explanation:

When you are designing a PID controller for a given system, follow the steps shown below to obtain a desired response.

Obtain an open-loop response and determine what needs to be improved

Add a proportional control to improve the rise time

Add a derivative control to reduce the overshoot

Add an integral control to reduce the steady-state error

Adjust each of the gains $K_p$, $K_i$, and $K_d$ until you obtain a desired overall response.

The further explanation is attached in the Word File.

Download docx
5 0
3 years ago
An isothermal CSTR with a first order irreversible reaction A â&gt; B (and rA[mol/(ft3*min)] = - 0.5 CA) has a constant flow rat
worty [1.4K]
Can you help me by solving this question

7 0
2 years ago
What are the dimensions of the base of the pyramid?
Cloud [144]

Answer:

b

Explanation:

bcus it is

7 0
2 years ago
You want to find all files on your server that have either the SGID or SUID permission set. Which command should you use to obta
aalyn [17]

Answer:

For SGID you type this

$ find . -perm /4000

For SUID you type this

$ find . -perm /2000

Explanation:

Auxiliary file permissions, that are commonly referred to as “special permissions” in Linux are needed in order to easily find files which have SUID (Setuid) and SGID (Setgid) set.

After typing

$ find directory -perm /permissions

Then type the commands in the attachment below to obtain a list of these files with SGID and SUID.

3 0
3 years ago
Consider a multiprocessor system and a multithreaded program written using the many-to-many threading model. Let the number of u
Montano1993 [528]

Answer:

At the point when the quantity of bit strings is not exactly the quantity of processors, at that point a portion of the processors would stay inert since the scheduler maps just part strings to processors and not client level strings to processors. At the point when the quantity of part strings is actually equivalent to the quantity of processors, at that point it is conceivable that the entirety of the processors may be used all the while. Be that as it may, when a part string obstructs inside the portion (because of a page flaw or while summoning framework calls), the comparing processor would stay inert. When there are more portion strings than processors, a blocked piece string could be swapped out for another bit string that is prepared to execute, in this way expanding the use of the multiprocessor system.When the quantity of part strings is not exactly the quantity of processors, at that point a portion of the processors would stay inert since the scheduler maps just bit strings to processors and not client level strings to processors. At the point when the quantity of bit strings is actually equivalent to the quantity of processors, at that point it is conceivable that the entirety of the processors may be used at the same time. Be that as it may, when a part string hinders inside the piece (because of a page flaw or while summoning framework calls), the relating processor would stay inert. When there are more portion strings than processors, a blocked piece string could be swapped out for another bit string that is prepared to execute, along these lines expanding the usage of the multiprocessor framework.

4 0
2 years ago
Other questions:
  • Write a grammar for a language whose sentences start with an even and non-zero number of x’s, end with an odd number of z’s, and
    11·1 answer
  • A cylindrical specimen of brass that has a diameter of 20 mm, a tensile modulus of 110 GPa, and a Poisson’s ratio of 0.35 is pul
    13·1 answer
  • Which of the following is not a primary or fundamental dimension? (a)-mass m (b)-length L (c)- timer t (d)-volume V
    5·1 answer
  • DO NOW: Name the three main legal categories of ownership.
    12·1 answer
  • In sleep, what does REM stand for?
    10·1 answer
  • *100 POINTS
    6·2 answers
  • Air enters a compressor operating at steady state at 1.05 bar, 300 K, with a volumetric flow rate of 21 m3/min and exits at 12 b
    11·1 answer
  • Stress that acts in the plane of a cut section, rather than at right angles to the section is called:_______
    6·1 answer
  • Describe the meaning of the different symbols and abbreviations found on the documents that they use
    11·1 answer
  • Oil, with density of 900 kg/m3 and kinematic viscosity of 0.00001 m2/s, flows at 0.2 m3/s through 500 m of 200-mm-diameter cast-
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!