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's the difference between accuracy and percision in measuring and gaging?
lidiya [134]

Answer:

The term Accuracy means that how close our result to the original result.

Suppose we do any experiment in laboratory and we calculate mass = 7 kg but answer is mass = 15 kg then our answer is not accurate.

And the term Precision means how likely we get result like this.

Suppose we do any experiment in laboratory and we calculate mass five times and each time we get mass = 7 kg then our answer is precised but not accurate.

4 0
3 years ago
By law, who is responsible for providing Safety Data Sheets?
nalin [4]

Answer:

OSHA Hazard Communication Standard is responsible.

Explanation:

5 0
3 years ago
Read 2 more answers
I’m building a pc, but I only have 2 sata cables. What are the other required cables to connect to or parts, such as the gpu?
Usimov [2.4K]

Answer:

You would also need power cables.

3 0
2 years ago
Read 2 more answers
Steam flowing through a long, thin walled pipe maintains the pipe wall at a uniform temperature of 500 K. The pipe is covered wi
hjlf

Answer: I would love to learn this

Explanation:

3 0
3 years ago
Two transmission belts pass over a double-sheaved pulley that is attached to an axle supported by bearings at A and D. The radiu
Fynjy0 [20]

Answer:

Check the explanation

Explanation:

Kindly check the attached image below to see the step by step explanation to the question above.

6 0
3 years ago
Other questions:
  • The boiler pressure is 38bar and the condenser pressure 0.032 bar.The saturated steam is superheated to 420 oC before entering t
    8·1 answer
  • A transformer winding contains 900 turns of wire which creates 400 ohms of primary importance how many terms of the same size wi
    8·1 answer
  • What type of companies would employ in mechanics engineering​
    8·1 answer
  • Water flows through a nozzle at the end of a fire hose. If the nozzle exit velocity must be 20 m/s and the exit diameter is 40 m
    6·1 answer
  • How are the accelerator and brake pedal positioned in relation to each other? A. The brake pedal is to the right of the accelera
    5·1 answer
  • HELP PLS
    7·1 answer
  • Which of the following best distinguishes between superficial design improvements and functional
    7·1 answer
  • Question 3
    14·1 answer
  • Although studs are sometimes spaced 24" O.C. in residential structures, a spacing of_____ O.C. is more commonly used.
    5·1 answer
  • What is the difference between absorbed wavelengths and reflected wavelengths?
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!