Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace StudentInformation
- {
- class Program
- {
- static void Main(string[] args)
- {
- int ns;
- Console.Write("Input Number of Students: ");
- ns = int.Parse(Console.ReadLine());
- Console.Clear();
- string[] fn = new string[ns];
- string[] mn = new string[ns];
- string[] ln = new string[ns];
- string[] address = new string[ns];
- string[] bday = new string[ns];
- double[] age = new double[ns];
- string[] course = new string[ns];
- string[] sec = new string[ns];
- for (int i = 0; i < fn.Length; i++)
- {
- Console.Write("Input First Name: ");
- fn[i] = Console.ReadLine();
- Console.Write("Input Middle Name: ");
- mn[i] = Console.ReadLine();
- Console.Write("Input Last Name: ");
- ln[i] = Console.ReadLine();
- Console.Write("Input Address: ");
- address[i] = Console.ReadLine();
- Console.Write("Input Birthday: ");
- bday[i] = Console.ReadLine();
- Console.Write("Input Age: ");
- age[i] = double.Parse(Console.ReadLine());
- Console.Write("Input Course: ");
- course[i] = Console.ReadLine();
- Console.Write("Input Section: ");
- sec[i] = Console.ReadLine();
- Console.Clear();
- }
- for (int i = 0; i < fn.Length; i++)
- {
- if (string.IsNullOrWhiteSpace(mn[i]))
- {
- Console.WriteLine("FULL NAME\t: {0} {1}", fn[i].ToUpper(), ln[i].ToUpper());
- Console.WriteLine("ADDRESS\t: {0}", address[i].ToUpper());
- Console.WriteLine("BIRTHDAY\t: " + bday[i].ToUpper());
- Console.WriteLine("AGE\t\t: {0}\nCOURSE\t: {1}\nSec\t\t: {2}", age[i], course[i].ToUpper(), sec[i]);
- }
- else
- {
- Console.WriteLine("FULL NAME\t: {0} {1}. {2}", fn[i].ToUpper(), mn[i].ToUpper()[0], ln[i].ToUpper());
- Console.WriteLine("ADDRESS\t: {0}", address[i].ToUpper());
- Console.WriteLine("BIRTHDAY\t: " + bday[i].ToUpper());
- Console.WriteLine("AGE\t\t: {0}\nCOURSE\t: {1}\nSec\t\t: {2}", age[i], course[i].ToUpper(), sec[i]);
- }
- }
- Console.ReadKey();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement