Advertisement
emmanuelbarrameda

Untitled

Dec 2nd, 2024
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.58 KB | None | 0 0
  1. using System;
  2.  
  3. namespace StudentInformation
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. int ns;
  10. Console.Write("Input Number of Students: ");
  11. ns = int.Parse(Console.ReadLine());
  12. Console.Clear();
  13.  
  14. string[] fn = new string[ns];
  15. string[] mn = new string[ns];
  16. string[] ln = new string[ns];
  17. string[] address = new string[ns];
  18. string[] bday = new string[ns];
  19. double[] age = new double[ns];
  20. string[] course = new string[ns];
  21. string[] sec = new string[ns];
  22.  
  23. for (int i = 0; i < fn.Length; i++)
  24. {
  25. Console.Write("Input First Name: ");
  26. fn[i] = Console.ReadLine();
  27.  
  28. Console.Write("Input Middle Name: ");
  29. mn[i] = Console.ReadLine();
  30.  
  31. Console.Write("Input Last Name: ");
  32. ln[i] = Console.ReadLine();
  33.  
  34. Console.Write("Input Address: ");
  35. address[i] = Console.ReadLine();
  36.  
  37. Console.Write("Input Birthday: ");
  38. bday[i] = Console.ReadLine();
  39.  
  40. Console.Write("Input Age: ");
  41. age[i] = double.Parse(Console.ReadLine());
  42.  
  43. Console.Write("Input Course: ");
  44. course[i] = Console.ReadLine();
  45.  
  46. Console.Write("Input Section: ");
  47. sec[i] = Console.ReadLine();
  48.  
  49. Console.Clear();
  50. }
  51.  
  52. for (int i = 0; i < fn.Length; i++)
  53. {
  54. if (string.IsNullOrWhiteSpace(mn[i]))
  55. {
  56. Console.WriteLine("FULL NAME\t: {0} {1}", fn[i].ToUpper(), ln[i].ToUpper());
  57. Console.WriteLine("ADDRESS\t: {0}", address[i].ToUpper());
  58. Console.WriteLine("BIRTHDAY\t: " + bday[i].ToUpper());
  59. Console.WriteLine("AGE\t\t: {0}\nCOURSE\t: {1}\nSec\t\t: {2}", age[i], course[i].ToUpper(), sec[i]);
  60. }
  61. else
  62. {
  63. Console.WriteLine("FULL NAME\t: {0} {1}. {2}", fn[i].ToUpper(), mn[i].ToUpper()[0], ln[i].ToUpper());
  64. Console.WriteLine("ADDRESS\t: {0}", address[i].ToUpper());
  65. Console.WriteLine("BIRTHDAY\t: " + bday[i].ToUpper());
  66. Console.WriteLine("AGE\t\t: {0}\nCOURSE\t: {1}\nSec\t\t: {2}", age[i], course[i].ToUpper(), sec[i]);
  67. }
  68. }
  69.  
  70. Console.ReadKey();
  71. }
  72. }
  73. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement