Question: Create a Java class called Family. The family class will have the following variables and methods: variables: number of family members type of family (this
Create a Java class called Family. The family class will have the following variables and methods:
variables:
- number of family members
- type of family (this may represent the extended, nuclear, joint, etc. family type)
- family surname
- number of weddings attended
- house physician( this variable is of the user-defined datatype)
methods:
- A toString() to print all the values in string format.
- Getter and setter methods to access and modify the variables (therefore the number of methods will be 2times the number of variables.)
- Constructors with and without parameters
- A method to increase the number of weddings attended each time the method is called.
Write the following functions in another Record Class: a. view for viewing records in your file, b. add for adding records in your file, c. search this function will read a search key (e.g. surname) from the user, search for that key in your file, and then show info of all the records that matches the search key; for example, if the user searches for all family whose name is Rahman then your program will show the info of all Family whose surname is Rahman d. edit this function will read a search key, show the info of all records which matches that key (just like the search function), asks the user to select which record s/he wants to edit/modify, read the new info given by the user and use those to replace the old values of that record.
Please note that the name you are using in family records those should be the real names that relates to you, do not use names from your friend's family. For other values, you can use imaginary values.
Create another Java class called Physician. The family class will have the following variables and methods:
variables:
- highest level of degree
- type of physician (this may represent the specialization of doctors expertise)
- surname
- number of visits to the family
- fee per visit
- total payment
methods:
- A toString() to print all the values in string format.
- Getter and setter methods to access and modify the variables (therefore the number of methods will be 2times the number of variables.)
- Constructors with and without parameters. Initially, the total payment and the total number of visits must be set to zero.
- A method to increase the number of visits each time the method is called.
- A method to decrease the number of visits each time the method is called, this may apply when an appointment is canceled.
- A method to determine and print the experience of the physician depending on the number of total visits.
Now, Create a separate DriverClass.
Create the Main method and call each and every method you have defined. Note That: **Please, Write all the Codes in Java Programming Language.** **Please, write all 4 classes, including the family class, record class, physician class and, Driver class.** **Write such a way that, I can Copy and, Paste all the Codes anywhere.** **Please, Post all the Screenshots of the Output.**
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
