forked from MedTech-CS311/StudentManagementSystem
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStudentManagementSystem.js
More file actions
71 lines (55 loc) · 1.18 KB
/
StudentManagementSystem.js
File metadata and controls
71 lines (55 loc) · 1.18 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
var numberOfStudents = 0
var students = []
var esm, initial
var firstName, lastName
function addStudent(esm) {
students.push(esm)
numberOfStudents = students.length
}
function getNumberOfStudent(){
return numberOfStudents
}
function clearStudents()
{
for (i=0; i<=students.length; i++)
{
students.pop()
}
numberOfStudents = 0
}
function createFullName(firstName, lastName)
{
return `${firstName} ${lastName}`
}
function isFullName(esm)
{
var poopy = esm.split(" ")
if (poopy.length > 1)
{return true}
}
function getStudentsByInitials(initial)
{
i=0
var initstudents = []
while (i < students.length)
{
if (students[i].charAt(0) === initial)
{initstudents.push(students[i])}
i++
}
console.log(initstudents)
}
console.log(students)
addStudent("Josh")
console.log(students)
addStudent("John")
addStudent("Jamel")
addStudent("Wael")
addStudent("Jalel")
addStudent("Monia")
addStudent("Jannet")
addStudent("Moncef")
console.log(students)
console.log(getNumberOfStudent())
console.log(students)
getStudentsByInitials("J")