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
If 5000 N of thrust is acting to the left, and 4300 N of drag is acting to the right, what is the magnitude and direction of the
Kipish [7]

Answer:

700 N acting to the left.

8 0
3 years ago
Por favor. alguien me comunique con fatimalisethmateual
lions [1.4K]
Wait why do you want me to
7 0
2 years ago
I have a 308 bullet stuck in my ak,s mag help?
Assoli18 [71]
Lick the bullet and push it down
3 0
3 years ago
Read 2 more answers
A design that is found to have flaws and must be redesigned and retested is an example of what
Aleksandr [31]

Answer:

A. prototype

Explanation:

7 0
3 years ago
Pilot testing:
andrew11 [14]

Answer:

c. allows planners to work out any problems before the program is launched

Explanation:

Pilot testing is simply aimed at getting it right before the launch of a program, it is also called pilot run, pilot project, feasibility run, etc. Pilot testing is the rehearsal or practice done for an idea, program, research study or invention with few participants prior to lunching out the main program. The main purpose of pilot testing is to determine how feasible a project is, it can also help to evaluate the cost of an idea, invention, research study, etc.

6 0
3 years ago
Other questions:
  • If 20 kg of iron, initially at 12 °C, is added to 30 kg of water, initially at 90 °C, what would be the final temperature of the
    6·1 answer
  • What is the resultant force on one side of a 25cm diameter circular plate standing at the bottom of 3m of pool water?
    12·1 answer
  • For a 68 wt% Zn-32 wt% Cu alloy, make schematic sketches of the microstructure that would be observed for conditions of very slo
    14·1 answer
  • Design an Armstrong indirect FM modulator to generate an FM signal with a carrier frequency 98.1 MHz and a frequency deviation △
    15·1 answer
  • The Hoover Dam is 221 m tall and 379 m wide. Approximating it as a flat plate, determine the effective resultant force on the da
    6·1 answer
  • Water flows with a velocity of 3 m/s in a rectangular channel 3 m wide at a depth of 3 m. What is the change in depth and in wat
    9·1 answer
  • The number of pulses per second from IGBTs is referred to as
    10·1 answer
  • What is the output of the following program fragment. Choose appropriate data-types of variables to match output.
    10·1 answer
  • How many times greater is the value of the 2 of the 270413 than the valuce of the 2 in 419427?
    8·1 answer
  • Military glorification through mosaics, relief carvings and triumphant arches are often associated with?
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!