-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathschool.php
More file actions
64 lines (52 loc) · 2.4 KB
/
school.php
File metadata and controls
64 lines (52 loc) · 2.4 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
<?php
//Students class average <70%:
//Dear Alena Holligan,
//We look forward to seeing you at summer school, beginning July 1st!
//Student class average >=70% and current grade 9
//Dear Alena Holligan,
//Congratulations on completing your freshman year in High School! We’ll see you on September 1st for the start of your sophomore year!
//Student class average >=70% and current grade 10
//Dear Alena Holligan,
//Congratulations on completing your sophomore year in High School! We’ll see you on September 1st for the start of your junior year!
//Student class average >=70% and current grade 11
//Dear Alena Holligan,
//Congratulations on completing your junior year in High School! We’ll see you on September 1st for the start of your senior year!
//Student class average >= 70% and current grade 12
//Dear Alena Holligan,
//Congratulations! You’ve graduated High School! Don’t forget to come back and visit.
$firstName = 'Robert';
$lastName = 'Bowman';
$currentGrade = 11;
$finalAverage = .88;
$messageBody = '';
if (!$firstName || !$lastName) {
echo 'Please enter a student name';
} elseif ($currentGrade < 9 || $currentGrade > 12) {
echo 'This is only for high school students. Please enter a grade between 9 and 12';
} else {
if ($finalAverage < .70) {
$messageBody = 'We look forward to seeing you at summer school, beginning July 1st!';
} else {
switch ($currentGrade) {
case '9':
$messageBody = 'Congratulations on completing your freshman year in High School! We’ll see you on September 1st for the start of your sophomore year!
';
break;
case '10';
$messageBody = 'Congratulations on completing your sophomore year in High School! We’ll see you on September 1st for the start of your junior year!';
break;
case '11';
$messageBody = 'Congratulations on completing your junior year in High School! We’ll see you on September 1st for the start of your senior year!';
break;
case '12';
$messageBody = 'Congratulations! You’ve graduated High School! Don’t forget to come back and visit.';
break;
default:
$messageBody = 'Error: Grade level is not 9-12';
break;
}
}
echo "Dear $firstName $lastName\n";
echo $messageBody;
}
?>