-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunctions1.php
More file actions
45 lines (35 loc) · 881 Bytes
/
functions1.php
File metadata and controls
45 lines (35 loc) · 881 Bytes
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
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<?
/* $test1 = 99;
$test2 = 89;
$test3 = 100;
$theAverage = ( $test1 + $test2 + $test3 ) / 3;
print( "The average score is: {$theAverage}<br>" );
$test1 = 65;
$test2 = 71;
$test3 = 100;
$theAverage = ( $test1 + $test2 + $test3 ) / 3;
print( "The average score is: {$theAverage}<br>" );
$test1 = 11;
$test2 = 66;
$test3 = 100;
$theAverage = ( $test1 + $test2 + $test3 ) / 3;
print( "The average score is: {$theAverage}<br>" );
*/
function getAverage( $t1, $t2, $t3 )
{
$theAverage = ( $t1 + $t2 + $t3 ) / 3;
$theAverage = number_format( $theAverage, 2 );
print( "The average score is: {$theAverage} <br> " );
}
getAverage( 99, 89, 100 );
getAverage( 65, 71, 100 );
getAverage( 11, 66, 100 );
?>
</body>
</html>