This document contains instructions for multiple programming assignments:
1) Draw a student inheritance hierarchy with Student as the superclass. Extend it with UndergraduateStudent and GraduateStudent, and further extend those classes to more specific student types.
2) Write Java code to implement the student inheritance hierarchy.
3) Create classes to model a hospital patient database, including classes for Patient, Date, and Hospital to store and manage patient records and dates.
4) Identify a potential issue with sample constructor code and how to fix it.
5) Write a method to generate random numbers and count the evens.
This document contains instructions for multiple programming assignments:
1) Draw a student inheritance hierarchy with Student as the superclass. Extend it with UndergraduateStudent and GraduateStudent, and further extend those classes to more specific student types.
2) Write Java code to implement the student inheritance hierarchy.
3) Create classes to model a hospital patient database, including classes for Patient, Date, and Hospital to store and manage patient records and dates.
4) Identify a potential issue with sample constructor code and how to fix it.
5) Write a method to generate random numbers and count the evens.
This document contains instructions for multiple programming assignments:
1) Draw a student inheritance hierarchy with Student as the superclass. Extend it with UndergraduateStudent and GraduateStudent, and further extend those classes to more specific student types.
2) Write Java code to implement the student inheritance hierarchy.
3) Create classes to model a hospital patient database, including classes for Patient, Date, and Hospital to store and manage patient records and dates.
4) Identify a potential issue with sample constructor code and how to fix it.
5) Write a method to generate random numbers and count the evens.
Draw an inheritance hierarchy for students at a university.
Use Student as the superdass of the
hierarchy, then extend Student with classes Undergraduate Student and Graduate Student Continue to extend the hierarchy as deep pe as muny levels) as possible For example, Freshman Sophomore, Junior and Senior might extend Undergraduate Student, and DoctoralStudent and MastersStudent might be subclasses of GraduatéStudent After drawing the hierarchy. i. Discuss the relationships that exist between the classes (10 marks) Write java code for the inheritance hierarchy for students at the university (15 marks) QUESTION 3 [25 marks] #include <iostream, h) Struct dala a) A hospital wants to create a database regarding its indoor patients. The information to store include -Name of the patient int d int m Age of the patient - Disease Date of admission Class hospital -Date of discharge Create a class called Patient to store the above nformation. The member methods should include methods to enter information and display the patient's information(5 marks). Such date Create class Date to have the date (year, month and day as its fields) and a method to display the Structure date date. (5 marks) Create c'ass Hospital to have an array list to store all patients. It has methods to add a patient to the list and to delete a patient from the list. It also has a method to display a list of all the patients in the hospital and a method to display only the patients whose age is less than 12. (10 marks) o) What might go wrong with the following code, what would you need to do to fix it. (2 marks) public class Test { int x; int y; public Test (int x, int y) { c) Write a method that generates 100 integer random numbers between 0 and 10 and counts the even numbers from those generated numbers. (3 marks) QUESTION 4 [25 marks]