List[Null, Null, Null, Null, Null, Null, Null, Notebook[List[Cell[CellGroupData[List[Cell["Exercise 4", "Title"], Cell[CellGroupData[List[Cell["Using Inheritance and Access Control", "Section"], Cell[TextData[List["Write a class, ", StyleBox["Person", Rule[FontFamily, "Courier"]], ", with the variables ", StyleBox["name", Rule[FontFamily, "Courier"]], ", ", StyleBox["weight", Rule[FontFamily, "Courier"]], " and ", StyleBox["ID", Rule[FontFamily, "Courier"]], ", where ", StyleBox["ID", Rule[FontFamily, "Courier"]], " should be protected. "]], "Text"], Cell["", "ModelicaInput"], Cell[TextData[List["\n\nThe next class ", StyleBox["Employed", Rule[FontFamily, "Courier"]], " should inherit from ", StyleBox["Person", Rule[FontFamily, "Courier"]], " and have a protected variable, salary. "]], "Text"], Cell["", "ModelicaInput"], Cell["\n\nThe last class, Programmer, contains the variables favProgLang(favorite programming language) and drinksJoltCola.", "Text"], Cell["", "ModelicaInput"], Cell[CellGroupData[List[Cell["Answer", "Subsection"], Cell["", "Text"], Cell["class Person\n  String name;\n  Real weight;\nprotected\n  Integer ID;\nend Person;", "ModelicaInput"], Cell["", "Text"], Cell["class Employed\n  extends Person;\nprotected\n  Real salary;\nend Employed;", "ModelicaInput"], Cell["", "Text"], Cell["class Programmer\n  extends Employed;\n  String favProgLang;\n  Boolean drinksJoltCola;\nend Programmer;", "ModelicaInput"]], Closed]]], Open]], Cell[CellGroupData[List[Cell["Question", "Section"], Cell[TextData[List["Which protected variable(s) does the class ", StyleBox["Employed", Rule[FontFamily, "Courier"]], " have?"]], "Text"], Cell[CellGroupData[List[Cell["Answer", "Subsection"], Cell[TextData[List[StyleBox["salary", Rule[FontFamily, "Courier"]], " and ", StyleBox["ID", Rule[FontFamily, "Courier"]]]], "Text"]], Closed]]], Open]], Cell[CellGroupData[List[Cell["A Different Exercise", "Section"], Cell[TextData[List["Use the same class ", StyleBox["Person", Rule[FontFamily, "Courier"]], ", but write a new class, ", StyleBox["Employed", Rule[FontFamily, "Courier"]], ", so that the variable ", StyleBox["salary", Rule[FontFamily, "Courier"]], " still is protected and as well as the ", StyleBox["extends clause", Rule[FontFamily, "Courier"]], "."]], "Text"], Cell[CellGroupData[List[Cell["Answer", "Subsection"], Cell["class Employed\nprotected\n  extends Person;\nprotected\n  Real salary;\nend Employed;", "ModelicaInput"]], Closed]]], Open]], Cell[CellGroupData[List[Cell["Question", "Section"], Cell[TextData[List["Now which protected variable(s) does the class ", StyleBox["Employed", Rule[FontFamily, "Courier"]], " have?"]], "Text"], Cell[CellGroupData[List[Cell["Answer", "Subsection"], Cell[TextData[List[StyleBox["name", Rule[FontFamily, "Courier"]], ",  ", StyleBox["weight, ", Rule[FontFamily, "Courier"]], StyleBox["salary", Rule[FontFamily, "Courier"]], " and ", StyleBox["ID", Rule[FontFamily, "Courier"]]]], "Text"]], Closed]]], Open]]], Open]]], Rule[FrontEndVersion, "4.1 for Microsoft Windows"], Rule[ScreenRectangle, List[List[0, 1024], List[0, 1207]]], Rule[WindowSize, List[758, 899]], Rule[WindowMargins, List[List[4, Automatic], List[Automatic, 3]]], Rule[StyleDefinitions, "MathModelica.nb"]], Null, Null, Null, Null, Null]