## Day 12 - inheritance

November 14, 2017

You are given two classes, Person and Student, where Person is the base class and Student is the derived class. Completed code for Person and a declaration for Student are provided for you in the editor. Observe that Student inherits all the properties of Person.

Complete the Student class by writing the following:

$\cdot \$ A Student class constructor, which has parameters:

$\quad$1. A string, $firstName$.

$\quad$2. A string, $lastName$.

$\quad$3. An integer,$id$.

$\quad$4. An integer array (or vector) of test scores, .

$\cdot \$ A char calculate() method that calculates a Student object’s average and returns the grade character representative of their calculated average:

Input Format

The locked stub code in your editor calls your Student class constructor and passes it the necessary arguments. It also calls the calculate method (which takes no arguments).

You are not responsible for reading the following input from stdin: The first line contains $firstName$, $LastName$, and $id$, respectively. The second line contains the number of test scores. The third line of space-separated integers describes $scores$.

Constraints

Output Format

This is handled by the locked stub code in your editor. Your output will be correct if your Student class constructor and calculate() method are properly implemented.

Sample Input

Heraldo Memelli 8135627

2

100 80

Sample Output

Name: Memelli, Heraldo

ID: 8135627

This student had $2$ scores to average:$100$ and $80$. The student’s average grade is $\frac{100+80}{2}=90$. An average grade of $90$ corresponds to the letter grade $O$, so our calculate() method should return the character’O’.