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
A 200-mm-long strip of metal is stretched in two steps, first to 300 mm and then to 400 mm. Show that the total true strain is t
Neko [114]

Explanation:

For true Strain:

step 1:

E true = Ln(1 + 0.5 ) = 0.40

Step 2:

E true = Ln(1 + 0.33 ) = 0.29

By single step process:

E true = Ln(1 + 1 ) = 0.69

total strain of step process = 0.40 + 0.29 = 0.69 units

SO TRUE STRAIN IS ADDITIVE.

4 0
3 years ago
Create two arrays with 5 elements each: one will hold Strings and the second will hold integers. Write a program to ask the user
MrMuchimi

Answer:

#include <iostream>

#include <iomanip>

#include <string>

using namespace std;

int main() {

   string name[5];  

   int age[5];  

   int i,j;  

   for ( i = 0; i<=4; i++ ) {  

       cout << "Please enter student's name:";  

       cin >> name[i];  

       cout << "Please enter student's age:";  

       cin >> age[i];          

   }  

for (i=0;i<=4;i++){

   cout<<"Age of  "<< name[i]<<"  is  "<<age[i]<<endl;  

}

}

Output of above program is displayed in figure attached.

5 0
3 years ago
A resistance of 30 ohms is placed in a circuit with a 90 volt battery. What current flows in the circuit?
blagie [28]

Answer:

3A

Explanation:

Using Ohms law U=I×R solve for I by I=U/R

4 0
3 years ago
7. Which of the following is a disadvantage of an electromagnet?
Sati [7]

Answer:

I think

electromagnets require power to operate

7 0
3 years ago
Unfiltered full wave rectifier with a 120 V 60 Hz input produces an output with a peak of 15V. When a capacitor-input filter and
Alborosie

Answer:

V_{pp}=2V

Explanation:

Source Voltage V= 120V

Frequency f=60Hz

Peak output voltage Vp=15V

Peak Output Voltage with filter V_p'=14V

Generally the equation for Peak to peak voltage is mathematically given by

V_p'=V_p-\frac{V_{pp}}{2}

Therefore

V_{pp}=2(V_p-v_p')

V_{pp}=2(15-14)

V_{pp}=2V

5 0
3 years ago
Other questions:
  • A murder in a downtown office building has been widely publicized. You’re a police detective and receive a phone call from a dig
    9·2 answers
  • The cables of a power line are copper-coated steel wire. The overall diameter of the wire is 5/8 in. The steel core has a diamet
    8·1 answer
  • The advantages of solar cells include all of the following, except a.moderate net energy yield b.little or no direct emissions o
    11·1 answer
  • Impact strips may be designed into a bumper cover.<br> True<br> False
    14·1 answer
  • A rectangular open box, 25 ft by 10 ft in plan and 12 ft deep weighs 40 tons. Sufficient amount of stones is placed in the box a
    13·1 answer
  • What is the moment that the wrench puts on the bolt?
    13·1 answer
  • true or false: the types of building materials that’s should be used in a project does not constitute a conditional for projects
    13·2 answers
  • A __________ defines the area of land that will supply water to a stream.
    9·1 answer
  • Which type of system is being researched to deliver power to several motors to drive multiple systems in vehicles?
    10·1 answer
  • How many hours should I charge a 4.8 volt 600mah battery(it is urgent)
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!