CIS485 EXAM04
WRITTEN VERSION
PART1 Class Question
1. Complete the following class:
Grade.php
Output File: Grade.php
PART2 Multi-File Application
2. Write a 2-file PHP form processor application where the input is two GUI values in a form
co
esponding to the midterm and final grades and for output the average grade is displayed
in NON-GUI plain text format. Call the scripts grade2.html and grade2.php. In the grade2.php
make sure to have a link back to the grade2.html. Make sure to use a Grade object to perform
any of the grade calculations. (50 pts)
FORMULA: average=(midterm+final)/2
Output File(s): grade2.html, grade2.php, Grade.php
Here is an example run on the inputs and output of the 2-file grade application:
XXXXXXXXXXgrade2.html XXXXXXXXXXgrade2.php
PART3- Single-File Application
3. Write a single file PHP GUI application that prompts the user for the midterm and final
grades and for output computes their average. All inputs and outputs must be displayed in
the same GUI form. Call the script grade3.php. Make sure to use a Grade object to perform
any of the grade calculations.( 50 pts)
FORMULA: average=(midterm+final)/2
Output File: grade3.php, Grade.php
Here is an example run on the inputs and output of the single file PHP grade application:
grade3.php
class Grade{
private $midterm;
private $final;
public function __construct($midterm,$final){...}
public function setMidterm($midterm){$this->midterm=(float)$midterm;}
public function getMidterm(){return $this->midterm;}
public function setFinal($final){$this->final=(float)$final;}
public function getFinal(){return $this->final;}
public function calcAverageGrade(){...;return $grade;}
}
cis485Exam04Files/grade3.html
GRADE3 PROBLEM
Midterm:
Final:
Averge:
cis485Exam04Files/grade2.html
GRADE2 PROBLEM
Midterm:
Final:
cis485Exam04Files/Grade.php
?php
class Grade{
private $midterm;
private $final;
public function __construct($midterm,$final){...}
public function setMidterm($midterm){$this->midterm=(float)$midterm;}
public function getMidterm(){return $this->midterm;}
public function setFinal($final){$this->final=(float)$final;}
public function getFinal(){return $this->final;}
public function calcAverageGrade(){...;return $grade;}
}
?>