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
slamgirl [31]
3 years ago
12

C#: Arrays - Ask the user how many students names they want to store. You will create two parallel arrays (e.g. 2 arrays with th

e same size, the first array will hold all of the students first names and the second array will hold all of the students last names). Once the user has input all of the students first names last names, output all of the students names in the following format: Lastname, Firstname. You must use two separate loops, the first to store the values in the arrays and the second to output all of the names.
Engineering
1 answer:
zhenek [66]3 years ago
4 0

Answer:

  1. using System;      
  2. public class Program
  3. {
  4. public static void Main()
  5. {
  6.  Console.WriteLine("Enter number of students: ");
  7.  int num = Convert.ToInt32(Console.ReadLine());
  8.  string [] firstName = new string[num];
  9.  string [] lastName = new string[num];
  10.  
  11.  for(int i=0 ; i < num; i++){
  12.   Console.WriteLine("Enter first name: ");
  13.   firstName[i] = Console.ReadLine();
  14.    
  15.   Console.WriteLine("Enter last name: ");
  16.   lastName[i] = Console.ReadLine();
  17.  }
  18.  
  19.  for(int j=0; j < num; j++){
  20.   Console.WriteLine(lastName[j] + "," + firstName[j]);
  21.  }
  22. }
  23. }

Explanation:

Firstly, prompt user to enter number of student to be stored (Line 6- 7). Next, create two array, firstName and lastName with num size (Line 8-9).

Create a for-loop to repeat for num times and prompt user to enter first name and last name and then store them in the firstName and lastName array, respectively (Line 11 - 17).

Create another for loop to traverse through the lastName and firstName array and display the last name and first name by following the format given in the question (Line 19 - 21).

You might be interested in
What is the next measurement after 2' -6" on the architect's scale?
Diano4ka-milaya [45]

Answer: I am not for sure

Explanation:

6 0
3 years ago
If angle A is a complement of angle B, angle B and angle C are vertical angles, and the supplement of C has a measure of 140°. F
Over [174]

Answer:

50°

Explanation:

Complementary angles add up to 90°.

Supplementary angles add up to 180°.

Vertical angles are equal.

A + B = 90°

B = C

C = 180° − 140°

C = 40°

B = 40°

A = 50°

7 0
3 years ago
Vehicles begin to arrive at a parking lot at 8:10 am at a constant rate of 6 veh/min until 8:25 am. There is no arrival from 8:2
tresset_1 [31]

1.i am superman

2.175 175 175

3.em dilisues

4.bye classmate magbabalik pa ako

8 0
2 years ago
Explain mathematically whether the divergence of the curl of a vector field is
svp [43]

Answer:

yes

Explanation:

6 0
2 years ago
A rigid 14-L vessel initially contains a mixture of liquid water and vapor at 100°C with 12.3 percent quality. The mixture is th
tigry1 [53]

Answer:

Q = 65.388 KJ

Explanation:

To calculate the heat required for the given process Q, we recall the energy balance equation.

Therefore, : Q = Δ U = m (u₂ - u₁) ..................equation (1)

We should note that there are no kinetic or potential energy change so the heat input in the system is converted only to internal energy.

Therefore, we will start the equation with the mass of the water (m) using given the initial percentage quality as x₁ = 0.123 and initial temperature t₁ = 100⁰c , we can them determine the initial specific volume v₁ of the mixture. For the calculation, we will also need the specific volume of liquid vₙ  = 0.001043m³/kg and water vapour (vₐ) = 1.6720m³/kg

Therefore, u₁ = vₙ + x₁ . ( vₐ - vₙ)

                   u₁ = 0.001043m³/kg + 0.123 . ( 1.6720m³/kg - 0.001043m³/kg)

                   u₁ = 0.2066m³/kg

Moving forward, the mass of the vapor can then be calculated using the given volume of tank V = 14 L but before the calculation, we need to convert the volume to from liters to m³.

Therefore, V = 14L . 1m² / 1000L = 0.014 m³

Hence, m = V / u₁

                 0.014m³ / 0.2066 m³/kg

              m = 0. 0677 kg

Also, the initial specific internal energy u₁ can be calculated using the given the initial given quality of x₁ , the specific internal energy of liquid water vₐ = 419.06 kj / kg and the specific internal energy of evaporation vₐₙ = 2087.0 kj/kg.

Therefore, u₁ = vₐ + x₁ . vₐₙ

                   u₁ = 419.06 kj / kg + 0.123  .  2087.0 kj/kg

                    u₁ = 675.76 kj/kg

For the final specific internal energy u₂, we first need to calculate the final quality of the mixture x₂ . The tank is rigid meaning the volume does not change and it is also closed meaning the mass does not change.from this, we can conclude the the specific volume also does not change during the process u₁ = u₂. This allows us to use the given final temperature T₂ = 180⁰c to determine the final quality x₂ of the mixture. for the calculation, we will also need the specific volume of liquid vₙ=0.001091m³/kg and vapor vₐ =  0.39248m³/kg

Hence, x₂ = u₂ - vₙ / uₐ

x₂ = 0.2066 m³/kg - 0.001091m³/kg / 0.39248m³/kg

x₂ = 0.524

Moving forward to calculate the final internal energy u₂, we have :

u₂ = vₙ + x₂ . vₙₐ

u₂ = 631.66 kj/kg + 0.524  . 1927.4 kj/kg

u₂ = 1641.62 kj/kg

We now return to equation (1) to plug in the values generated thus far

Q = m (u₂ - u₁)

0. 0677 kg ( 1641.62 kj/kg - 675.76 kj/kg)

Q = 65.388KJ

7 0
3 years ago
Read 2 more answers
Other questions:
  • Which of the following factors does not promote safety in the shop?
    15·1 answer
  • Consider a circular grill whose diameter is 0.3 m. The bottom of the grill is covered with hot coal bricks at 961 K, while the w
    10·1 answer
  • Ayuda porfavor es para una tarea de mi capacitación de desarrollo microempresarial
    14·1 answer
  • What Degree Do You Need To Become a Solar Engineer?<br> (2 or more sentences please)
    13·1 answer
  • A four-lane freeway (two lanes in each direction) is located on rolling terrain and has 12-ft lanes, no lateral obstructions wit
    14·1 answer
  • Calculate the resistance using Voltage and current, again using voltage and power, again using current and power, and again usin
    12·1 answer
  • ‏What is the potential energy in joules of a 12 kg ( mass ) at 25 m above a datum plane ?
    7·1 answer
  • 4. What are the basic scientific principles the engineers who designed the digital scales would have needed to understand to des
    5·1 answer
  • In what way is a spud wrench different from a pipe wrench?<br><br> See picture
    5·2 answers
  • How will the delay and active power per device change as you increase the doping density of both the N- and the P-MOSFET?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!