This repository was archived by the owner on Apr 3, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
87 lines (73 loc) · 2.97 KB
/
Program.cs
File metadata and controls
87 lines (73 loc) · 2.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
using Console_StudentManagementSystem.lib;
namespace Console_StudentManagementSystem
{
internal abstract class ConsoleApp
{
public static void Main()
{
// Initialize the array of strings
// Initialize an MS class
var ms = new Ms();
string[] array =
["name", "Date of birth (mm/dd/yyyy)", "Admission Points", "Programs (separated by commas)"];
ms.InitializeSubject();
Console.Clear();
ProgramIntroduction();
InitializeStudent(0, 2, array, ms);
ms.PrintInfo();
}
private static void ProgramIntroduction()
{
const string text = """
Welcome to krigjo25's Vocational college...
Throught the initialization the program will Ainitialize a list of subjects for the School, and students,
Then enroll the students in the chosen subject, The program will do a check on student's
final assessment, if the student has passed the Student will receive the ap ( Admission Points)
The program will then print the students' information
""";
ConsoleTypeEffect(text);
}
public static void ConsoleTypeEffect(string text)
{
foreach (char c in text)
{
Console.Write(c);
Thread.Sleep(3);
}
Console.Write("\n");
}
private static void InitializeStudent(int counter, int n, string[] array, Ms obj)
{
var arg = new string[3];
var program = new List<string>();
while (counter < n)
{
foreach (var element in array)
{
Console.WriteLine($"Enter the {element} of Student");
if (element.ToLower().Contains("programs"))
foreach (var sub in obj.Subjects)
ConsoleTypeEffect(
$"Subject: {sub.Name} Student require least {sub.AdmissionScore}AP. If the student has a passing grade in this program, the student will recieve {sub.Creds} Creds");
var input = Console.ReadLine();
if (input != null)
{
if (element.ToLower().Contains("programs"))
{
ConsoleTypeEffect(input);
program.AddRange(input.Split(","));
break;
}
arg[counter] = input;
counter++;
}
else
{
break;
}
}
obj.PushStudent(new Student(arg, program));
}
}
}
}