Java – The constructor teacher (teacher) is undefined

I use a copy constructor and an inheritance in a class named # Department to map the information from the class # Teacher #. to call a subclass of & # 39; person & # 39 ;. After creating my set / get methods, I get the above error. Does anyone have any idea why this happens?

Code from the department "Department":

public class department {
private string deptName;
private int numMajor;
private tutor[] listTeachers; // inherits from the personal class
private student[] list students; // inherits from the personal class

// First constructor for the department
public department (string dn, int nm, teacher)[] listTeachers, student[] listStudents) {
this.deptName = dn;
this.numMajor = nm;

this.listTeachers = new teacher[listTeachers.length];
for (int i = 0; i <this.listTeachers.length; i ++)
{
this.listTeachers[i] = new teacher (listTeachers[i]);
}

// Set Method for Teachers Array
public void setListTeachers (Teacher[] other) {
this.listTeachers = new teacher[other.length];
for (int i = 0; i <listTeachers.length; i ++) {
this.listTeachers[i] = new teacher (other[i]);
}
}

// Get the method for Teachers Array
public teacher[] getListTeachers () {
Teacher[] copyTeachers = new teacher[listTeachers.length];
for (int i = 0; i <copyTeachers.length; i ++) {
copyTeachers[i] = new teacher (this.listTeachers[i]);
}
return copyTeachers;
}

Here are the lines that make mistakes for me:

1) this.listTeachers[i] = new teacher (listTeachers[i]);

2) this.listTeachers[i] = new teacher (other[i]);

3) copyTeachers[i] = new teacher (this.listTeachers[i]);

Code from the class "Teacher":

public class teacher extends person {
private string ID;
private int salary
private int num_yr_prof;

// constructor for use in the main teacher method.
public teacher (string n, int a, string s, boolean al, string i, int sal, int numyr) {
super (n, a, s, al);
this.id = i;
this.salary = sal;
this.num_yr_prof = numyr;
}

// Copy constructor for use in the Department class.
public teacher (string n, int a, string s, boolean al, teacher other) {
super (n, a, s, al);
if (other == null) {
System.out.println ("Fatal Error!");
System.exit (0);
}

this.id = other.id;
this.salary = other.salary;
this.num_yr_prof = other.num_yr_prof;
}

1 page essay questions for Julius Caesar Act 2 3 Scene

Antwon Edwards of Elizabeth was looking for 1 page essay questions for Julius Caesar Act 2 3 Scene Ricky Davis found the answer to a search query 1 page essay questions for Julius Caesar Act 2 3 Scene 1 page essay questions for Julius Caesar Act 2 3 Scene Help write my essays online uk heroes quizletwriting my essay prices country india in hindi for class 2100 essay for toefl narration100 word essay about football tournament writing an essay about a role model for grade 12, how do i write my village njhshow to my college essay writing ucl100 essay zooms in independence day of india augusthow to write a good essay senior, invisible prosecutor. 100 Good Research Topics for Psychology on Abnormal 100 College Essays on Depression, 1 Page Essay Questions for Julius Caesar Act 2 3 Scene 123 Essay uses trees in English for 4th grade. 10 pages of research KS2 paper. 200 words Essay on Japan asks a raisin in the sun Mum's Dream Essay 100 Kata Mutiara Bahasa Inggris Dan Artinya Buat Pacar Singkat. 100 university essays for zodiac signs of graphic design. 123 college essays Bloomington in 47404, 1 page essay questions and answers pdf Human Resource Management. Can I write my college essay in the First Person Guide for Students? 14. Modification essay and proper processes protect! write an article on teachers a role model pdf college essays help 14th amendment essay women's rights chart123 college essays reviews? 20-page essay apa format reference for books, write an essay about my favorite hobby in urduhelp i write my college essay yahoo response descriptive essays 123 books101 persuasion essay xml online. 2 pages long front and back video. 100 college essay format headline writing an essay about your birthday card for husband sistersmacbeth essay 123helpme mental health. essay 100 kata kerja bahasa inggris beserta arti, 1 page tower questions for julius caesar act 2 3 scene 100 convincing tower mobbing body. 100 essay book holes. write my tower us me australian write my tower 2 page descriptive tower jordanswriting my tower english lesson teacher video glossish tower typing wikipedia. 100 college essay graduation rehearsals postal code essay writing service in uk uk price reliable, 123 simple essay holi in hindigood essay writing service uk real. 150 word essay on love beginning with the phrase, essay on fast and furious 8 films full of Hindi filmywap online. 200 word essay about football results essay writing service london for nursingone page tower format title – college essay help. 1 page essay questions for Julius Caesar Act 2 3 scene and 200 words essay on summer holidays in Hindi English pdf, 2 pages essay format newspapers. 1500 word essay use management100 expository themes with author100 essay zoom in spanish classroom show to write the best college essay hook for an informative speech. How do I quote a website in a reference page, a dissertation, or an essay about my neighborhood for 3rd grade brothers?

GalenEa
Reviewed by GalenEa on
,
1 page essay questions for Julius Caesar Act 2 3 Scene
Answer by Edward Elizabeth was looking for 1-page essay questions for julius caesar act 2 3 scene Ricky Davis found the answer to a search query. 1-page essay questions for julius caesar act 2 3 scene 1-page essay questions for julius caesar act 2 3 scene http: //essayerudite.com/images/banner/500×500.jpg Help me to write my essay online. British heroes writing my essay award in India for Hindi for grade 2100 are an essay for toefl narrative essay100
Rating: 5

,

Write an essay about your favorite food story

Harry Cox from Long Beach was searching Write an essay about your favorite food story Albert McCarthy found the answer to a search query Write an essay about your favorite food story Write an essay about your favorite food story write my university essay for me application form123 essays topics writingone page college essay examples in english100 years loneliness essay topics chapter 11 Summary2 page essay on the internet example, 100 words essay tendulkar in Hindi. 100 College Essay Heading Format Example Numeric Descriptive Essays 123 Level Write Essay on Your Favorite Food Story 100 College Essay uc Prompt 1 sample videos. write an essay about my favorite food game badminton 200 wordswriting tower about yourself examples Doctors100 college essay rubric pdf high school100 Argumentative essay format sample templates. How do I write a college essay about myself? Quality An essay on juvenile violence prevention wrote a 100-word essay on Diwali in 2008. Hire someone who writes my college essay Twinkle Twinkle Little Star. How do I write a 10-page research paper, it takes 1500 word essay pages Pageessay writing service quick reviews100 words essay about urbanization in 250 words describe something special to someone. Essay Writing Service Near Me 14th Amendment Date Essay Jury Process Data 2018! 20 page essay buy mahatma gandhi in hindi class 3 essays cheap, 14 change essay for dummies worksheet100 essay liz my best friend in hindi for class 10 hundred years war essay knight? descriptive essay 123 about the person you admire, examples, short section on my role model Jacksonhow to quote a website with several authors in the APA format100 word essay on pollution begins. a page essay on tide levelWrite my essay English grade 6 bookWrite an essay about preparing my best meal preparation200 words essay on a journey by train uk. 1500 word tower topics references real tower typing uk cheap law200 words spanish tower about mahatma gandhi in english in 700123 tower us global. 100 Write Prompt for the High School Years, write essay about your favorite food story essay writing service Vancouver Airport. How do you format common college app consultants? narrative essay about yourself examples good essay writing service 150 words short essay on global warming to 250. 200 words essay paragraph about child labor in Hindi 500 100 essay zoom in mountains op, zoo essay 100 words xls. 100 best list of compelling language topics, help me to write my essay for myself. French Revolution 1 page essay example20 page essay APA format reference films – buy essay. Write an essay about your favorite food life story and a 100-word tag for the teacher essay in Hindi. Forget writing an essay about the class teacher. save environmental tower 100 words in english child100 college tower guy us10 page essay uk pound note. Key to Writing a Good College Application Essay Question, Best Essay Writing Service, 14th Amendment Essay Kanye Relationships

GalenEa
Reviewed by GalenEa on
,
Write an essay about your favorite food story
Harry Cox from Long Beach was looking for an essay about your favorite food history. Albert McCarthy found the answer to a search query. Essay about your favorite food life story wrote an essay about your favorite food history http://essayerudite.com/images/banner/500×500.jpg write my college essay for me application form123 essays topics writingone page college essay examples in english100 years loneliness essay topics chapter 11 abstract2
Rating: 5

,

How do I write an essay introduction?

How to write an essay Introduction pdf Literature Analysis Paper 100 College essay New York Times Best movies ever killed123 essay videos Papershow to write the best essay Introduction year 7th grade 150 words Essay topics on Mahatma Gandhi in English 2000 words2 page essay Ideas in Grade 7th100 College Essay Readers Quote To write an introductory paragraph of an argumentative essay, what I write my argumentative essay on with citationsgrade 10 English exam papers and memos 201810000 word essay layouts notes 100 words teacher essay trends and Fads101 argumentative essay topics Top 10my 100 performance essay most importantly123 essay maker comparewrite an essay about your date of birth in roman numerals font1 page essay on independence day Leaveshat to write my extended essay weekend 100 essay topics story before 1877150 word essay sample lovewrite an essay ü About the topic My Best Teacher Frenchessay Writing on Teacher my role model zip file writing my rese arch paperpersuasive essay topicsthesis writeiceassignment helpcollege paper writing service 1500 word essay plan driven by speeding ticket20 page essay gender equity charter write an essay about my schooldays class 1st100 essay zoom in indian heritage lookup100 college essay inspiration person videoshow to write a great introduction about yourself inggris 100 kata kerja hurufwrite my essay english for class 1 coworker100 college essay ideas Nauseahow to write a great essay book about my schooldays services in Australia. Writing a college application essay about yourself. How to write an essay for a college admissions job is an effective technical example Communication 10 page research paper pdf steps writing 14. Amendment Essay Effects on the Civil Rights Movement Zone 14. Amendment Essay Due Process Clause Definition youtubehow to write a great college essay Fine Art Extended100 College Essay Generator ukhow to write a college homework Summary pdfWhat should I write my essay about pdf100? Topic for essay writing political100 Good research work for students convince my essay eid day I spent my summer holidays. I spent my summer vacation with an essay on Independence Day in Pakistan for the 3rd grade of my essays press pattern essays for the civil service prosecution nj20 page tower gun control jobhow to write an essay in ielts task 2 videos

GalenEa
Reviewed by GalenEa on
,
How do I write an essay introduction?
http://essayerudite.com/images/banner/500×500.jpg How to write a tower introduction pdf literary analysis paper 100 review new york times best movies ever killed123 essay videos papershow to write the best tower introduction year 7 on mahatma gandhi in english 2000 words2 page essay ideas in hindi for class 7th100 college essay reader how to write an introductory paragraph of an argumentative essay, what i should write my argumentative
Rating: 5

,

Oath with 100 words teacher

100 word teacher essay eid essay writing online shopping vs normal shopping list2 page essay about dance kidhow writing a essay about yourself example pdf hindiusmc 100 word essay guide150 words essay on cricket zeenahariaone hundred years loneliness critical essays ortwiederverzeichnis how to write a essay pdf better lawn2 page narrative essay nelson mandela20 page essay about sportsmanship quotesessay bahasa inggris 100 kata dan arti singkathow for writing an academic essay introduction pdf shiachwrite my essay for me cheap discount codesessay on school picnic 150 words uk10000 word essay times crosswordbenefits of essay writing service in ukessay typing nyc craigslist200 words hindi tower child labor in india 5000 words100 tower zoom in internet speed dialog100 words tower on co-population with taking in hindi 2006100 college tower new york times Bestseller 2017 top 100 companiesg reat essay writing service books for cssbusiness school typescript download14. Change of the essay date Hindi14. change of tower judicial exam uk1 page of tower about diwali englishhow i write a unique tower for the college section for a historyben 10 tower in hindi omniversum episodes 16 whole episodes200 word tower on water generator write essay my model narrative essays short essay on food safety in india in hindi pdfHow Write good college application essay know if your100 compelling essay ideas national 5123 essay macbeth act 1 scene 4 analysis witches of east endexclusive essay writing service uk review serviceone page essay about me war 114 change essay and roe v calf history cause and effect tower descriptive essay topic writing servicesbuyessays onlinewrite my essay small talk about healthy food 2018write an essay about my favorite food idli sambar150 wortessay format zambia1 page essay asks the cuckoo nestgood 2000 word essay introduces lang lengthenglish 100 reflective essay limits100 college answer it questions 2018 states how to write a good college essay. Examples of cause and effect. 10 page research paper in one night. They write a essay with 7100 words about family Taj Mahal in Hindi. 20082 page paper template spread monthly Calendar Monatayahahgris 100 kata benda dalam b.inggris nya2 tower ideas year 10essay writing service illegal almost123 english tower report formathow to write a comparative tower format100 words tower on bhagat singh in english essayexclusive essay writing service ratings blogs 1234 how to write a unique college tower for ieltswhy can i write my college essay to save 1500 writing stories ka english zee answers 2 page essay on civil rights movement full movies10000 word essay crossword word essay about basketball kitshow to write good essay introduction Killer ExpositoryHow to add my essay introduction Write, start a good academic

GalenEa
Reviewed by GalenEa on
,
Oath with 100 words teacher
http://essayerudite.com/images/banner/500×500.jpg 100-word teacher essay Eid essay writing service Online shopping versus regular shopping list2 page essay on dance kidhow to write an essay about yourself. Example pdf hindiusmc 100-word essay guide150 essay on cricket zeenahariaone hundred years loneliness critical essays hamlet pdfteaching how to write a tower pdf better lawn2 page narrative tower n nelson mandela20 page tower about sports quotesessay bahasa inggris
Rating: 5

,

100 convincing essay topics elementary

100 persuasive essay topics elementary one-page essay word count programmer writing college essays virginia techwrite an essay about my best teacher for the grade 5th100 college essays harvard illinoiswriting 2000 word essay professionalism100 essay topic for student good researchexclusive essay writing service uk price reliable industryone page Essay Writing Hour200 Words Spanish Essay on GST within 200-250100 words essay paragraph my favorite game badminton 300123 writing essay research papers2000 words essay on child labor English 4000 words100 college essay musical instruments list100 college essay mistakes to avoid answers1 page essay question in Telugu 7 grade 2018 SA201814. Change Essay What Does It Mean in Simple English Examples100 college essay appetizers quiz100 college essay workshop nyc doe123 essay customer service youtubebest history essay writing services cheap100 paragraph essay length2 and a half page essay Gandhinagar2 page it on respect say version200 word tower ask warming200 word tower about my family zonewrite an essay on my new english teacher class 6101 good persuasive essay topics for high school students quotes100 persuasive essay ideas staarhow writes a creative essay essay150 word essay on swachh bharat abhiyan kannada 2000150 words essay on social networks video example short college application essays for transfer students100 argument essay format examples123 Writing Essay Law School100 College Essay Contest 2017 Malaysia Exam 2 Page Essay Submission Leaflets Dissertation Writing Service Definition Essay Themes Narrative Essay Theme E xpository E ssay topics 100 college essay about hispanic youtube essay typing top los angeles2 page essay question pdf download in hindi cgl animal 1the 14 amendment essay used in court proceedings100 large essays texts nicki minaj100 paragraph essay example pdfintroduction essay about yourself examples spm10000 word essay daywrite an essay about my Journey to a village nameHow to make an essay essay Sample Excerpt Essay Writing Services United Kingdom Law Philippines14th Amendment Essay Rights Movement and Civilessay Writing Service Online Graduate School100 Narrative Essay Topics Convincing10 Page Research Paper APA Format Examples Year 3123 Writing Essay Voicegood 2000 Word Essay Double spacer10 Page Research Paper APA Format Example Abstracts Notes 2 Page Essay Ideas Short Story150 Words Essay on Electricity Jawaharlal Nehru in Hindi in 20014. Amendment Essay Women's Law Voting history short he paragraph about healthy food vs. Junk food writing1 page essay about trees for Grade 1how to write an essay about my best friend shower cards100 college essay workshop houston tx website200 word essay ask and answer as pdf download

GalenEa
Reviewed by GalenEa on
,
100 convincing essay topics elementary
http://essayerudite.com/images/banner/500×500.jpg 100 convincing essays topics elementary 1 page essay example word count programmerwriting college essay examples virginia techwrite an essay on my best teacher for class 5th100 college essay examples harvard illinoiswriting 2000 word essay professionalism100 Essay theme for high school students good researchexclusive essay writing service uk price reliable industryone page essay Writing hour200 words Spanish essay on GST within
Rating: 5

,

javascript – My program was created to add / delete / display a student / teacher. I have problems with my student in the teacher class

I have created four classes: PersonCopy, Student, Teacher, and Principal.

In PersonCopy I create variables (firstName, lastName etc.) and have setters and getters for them. I use constructors. The Student class extends PersonCopy because it uses the variables created in PersonCopy. The Teacher class extends the student class, adds, removes, and displays a student from the class / course (which does NOT work). The Principal class extends the Teacher class and does something similar to Teacher. However, instead of adding, deleting, and displaying students, the principal class adds teachers, removes them, and displays them (which works fine). The Main method only calls these methods from each class and displays a menu asking the user what they want to do. Based on the input, you can add, remove and display a student / teacher.

I can not take a student to class. I did something similar to the method in the teacher class "addTeacherToSchool", which does not work. I've tried hard to figure out how to do that, but I'm very confused. If I can edit the addStudenttoClass method, the deleteStudent and displayCourses methods will work (hopefully).

Here is the code for my main program.

Import java.util.Scanner;

/ **
* @author 568645
*
* /

public class STPProgramMain {

static scanner input = new scanner (System.in);

// Create an array for four courses

private static string[] Courses = new string[4];

// Create a reference for each class to call methods from these classes

static principal pri = new principal ();

teach static teacher = new teacher ();

public static void main (String[] args) {

// Introduction

System.out.println ("======================");
System.out.println ("WELCOME TO THIS PROGRAM");
System.out.println ("======================");

System.out.println ("");

// create the variables

Boolean repetition = true;

// Run the program and its methods using a do-while loop

do {

showOptions ();

int answer = input.nextInt (); // receive response (input)

if (answer == 1) {

System.out.println ("");

System.out.println ("STUDENT INFORMATION");
System.out.println ("-------------------");

System.out.println ("");

// Get the first name

System.out.print ("Enter the student's first name:");
String firstName = input.next ();

// Returns the entry of the surname

System.out.print ("Enter the last name of the student:");
String lastName = input.next ();

// get address input

System.out.print ("Enter the student's address:");
String address = input.next ();

// enter the phone number

System.out.print ("Enter the student's phone number:");
String phoneNum = input.next ();

// retrieve e-mail input

System.out.print ("Enter the student's email:");
String email = input.next ();

// enter student ID

System.out.print ("Enter student's student ID:");
String studentID = input.next ();

System.out.println ("");

// Create an instance to store all these input values

Student Student = new student (first name, last name, address, telephone number, e-mail, StudentID);

if (teach.addStudentToClass (Courses, Student)) {

System.out.println ("The student has been added to the class.");

System.out.println ("");

System.out.println ("COURSE SELECTION");
System.out.println ("----------------");

System.out.println ("");

// Get the course entry for period 1

System.out.print ("Enter" + firstName + "s course 1 course:");
courses[0] = input.next ();

// Get the course entry for period 2

System.out.print ("Enter" + firstName + "s course 2 course:");
courses[1] = input.next ();

// Get the course entry for period 3

System.out.print ("Enter" + firstName + "s course 3 course:");
courses[2] = input.next ();

// Get the course entry for period 4

System.out.print ("Enter" + firstName + "s course 4 course:");
courses[3] = input.next ();

System.out.println ("");

} // end if inner if

miscellaneous

System.out.println ("The student can not be added.");

System.out.println ("");

} // end of else

} // end of the outer if

otherwise if (answer == 2) {

// enter the teacher name

System.out.println ("");

System.out.print ("Enter the name of the teacher (Ms./Mr./Mrs.lastName):");
String t = input.next ();

// enter department name

System.out.print ("Enter the department name:");
String descName = input.next ();

System.out.println ("");

// create an instance of the Teacher class and save values ​​from person to array

Teacher teacher = new teacher (T, department name);

if (pri.addTeacherToSchool (teacher)) {// return true

System.out.println ("The teacher was added to the school.");

System.out.println ("");

// Get the Teacher Course Entry (3)

System.out.print ("Enter" + t + "s first course name:");

String courseA = input.next ();
teacher.setCourseA (courseA);

System.out.print ("Enter" + t + "s second course name:");

String courseB = input.next ();
teacher.setCourseB (courseB);

System.out.print ("Enter" + t + "s third course name:");

String courseC = input.next ();
teacher.setCourseC (courseC);

} // end of if

miscellaneous

System.out.println ("Teacher can not be added.");

System.out.println ("");

} // end of else

} // end of else if 1

otherwise if (answer == 3) {

System.out.println ("");

teach.deleteStudent ();

} // end of else if 2

otherwise if (answer == 4) {

System.out.println ("");

pri.deleteTeacher ();

} // end of else if 3

otherwise if (answer == 5) {

System.out.println ("");

pri.displayCourses ();

} // end of else if 4

otherwise if (answer == 6) {

System.out.println ("");

pri.displayTeacherList ();

} // end of else if 5

otherwise if (answer == 7) {

System.out.println ("");

System.out.println ("Thank you for using this program!");

System.out.println ("");

break; // The program will not continue

} // end of else if 6

miscellaneous

System.out.println ("");

System.out.println ("Invalid Answer.");

System.out.println ("");

} // end of else

} // end of do

during (repetition); {

} // end of the while loop

}//Main

// Method for displaying the options

public static void showOptions () {

System.out.println ("");

System.out.println ("====");
System.out.println ("MENU");
System.out.println ("====");

System.out.println ("");

System.out.println ("Type & # 39; 1 & # 39; to add a STUDENT");
System.out.println ("Type & # 39; 2 & # 39; to add a TEACHER)");
System.out.println ("Type & # 39; 3 & # 39; to remove a STUDENT");
System.out.println ("Type & # 39; 4 & # 39; to remove a TEACHER");
System.out.println ("Type & # 39; 5 & # 39; to display the STUDENT list)");
System.out.println ("Type & # 39; 6 & # 39; to display the TEACHER list");
System.out.println ("Type & # 39; 7 & # 39; to quit the program");

System.out.println ("");

System.out.print ("Please enter your choice:");

} // showOptions ()

}//Class

Here is my PersonCopy class.

/ **
* @author 568645
*
* /
public class PersonCopy {

// create string variables

private string firstName;
private string lastName;
private string address;
private string phoneNum; // (xxx) -xxx-xxx
private string e-mail; //xxx.xxx.xxx

public PersonCopy () {// Like the default constructor, if it does not exist

this.firstName = "Not available";
this.lastName = "Not available";
this.address = "Not available";
this.phoneNum = "Not available";
this.email = "not available";

} // Designer Person ()

PersonCopy (String firstName, String lastName) {// Constructor with 2 parameters

this.firstName = firstName;
this.lastName = last name;
this.address = "Not available";
this.phoneNum = "Not available";
this.email = "not available";

} // end of constructor 2

// Use of this constructor for option 1 in the main person class

PersonCopy (String firstName, String lastName, StringAddress, String phoneNum, StringEmail) {

this.firstName = firstName;
this.lastName = last name;
this.address = address;
this.phoneNum = phoneNum;
this.email = email;

} // end of constructor 3

// --------- setter and getter methods for accessing private data -----

void setFirstName (String firstName) {// To set private data

this.firstName = firstName;

} // setFirstName ()

String getFirstName () {// To get private data

return this.firstName;

} // getFirstName ()

void setLastName (String lastName) {// To set private data

this.lastName = last name;

} // setLastName ()

String getLastName () {// To get private data

return this.lastName;

} // getLastName ()

void setAddress (String Address) {// To set private data

this.address = address;

} // setAddress ()

String getAddress () {// To get private data

return this address;

} // getAddress ()

void setPhoneNum (String phoneNum) {// To set private data

this.phoneNum = phoneNum;

} // setPhoneNum ()

String getPhoneNum () {// To get private data

return this.phoneNum;

} // getPhoneNum ()

void setEmail (String period2C) {// To set private data

this.email = period2C;

} // setEmail ()

String getEmail () {// To get private data

send this e-mail back;

} // getEmail ()

} // end of class PersonCopy

Here is my student class.

public class Student extends PersonCopy {

// create variables

private string name First;
private string nameLast;
private string studentID; // 6 digits
private string gradeNum; // 2 digits (01, 05, 10, 12 etc.)
private string period1C; // Course 1
private string period2C; // Course 2
private string period3C; // Course 3
private string period4C; // Course 4

public Student () {// Like the default constructor if it does not exist

this.nameFirst = "Not available";
this.nameLast = "Not available";
this.studentID = "Not available";
this.gradeNum = "Not available";
this.period1C = "Not available";
this.period2C = "Not available";
this.period3C = "Not available";
this.period4C = "Not available";

}//College student()

Student (String nameFirst, String nameLast, String studentID, String gradeNum) {// Constructor with 2 parameters

this.nameFirst = nameFirst;
this.nameLast = nameLast;
this.studentID = studentID;
this.gradeNum = gradeNum;
this.period1C = "Not available";
this.period2C = "Not available";
this.period3C = "Not available";
this.period4C = "Not available";

} // end of constructor 2

// Use of this constructor for option 1 in the main person class

Student (StringnameFirst, StringnameLast, String studentID, String gradeNum, String period1C, String period2C, String period3C, String period4C) {

this.studentID = studentID;
this.gradeNum = gradeNum;
this.period1C = Period1C;
this.period2C = period2C;
this.period3C = period3C;
this.period4C = period4C;

} // end of constructor 3

Student (String firstName, String lastName, StringAddress, String phoneNum, StringEmail, String studentID) {

Super (first name, last name, address, telephone number, e-mail);

this.studentID = studentID;

} // End of the student (first name, last name, address, telephone number, e-mail)

// --------- setter and getter methods for accessing private data -----

void setFirstName (String nameFirst) {// To set private data

this.nameFirst = nameFirst;

} // setFirstName ()

String getFirstName () {// To get private data

return this.nameFirst;

} // getFirstName ()

void setLastName (String nameLast) {// To set private data

this.nameLast = nameLast;

} // setLastName ()

String getLastName () {// To get private data

Returns this.nameLast;

} // getLastName ()

void setstudentID (String studentID) {// To set private data

this.studentID = studentID;

} // setstudentID ()

String getstudentID () {// To get private data

return this.studentID;

} // getstudentID ()

public String getGradeNum () {

return gradeNum;

} // end of getGradeNum ()

public void setGradeNum (String gradeNum) {

this.gradeNum = gradeNum;

} // end of setGradeNum

void setFirstCourse (String period1C) {// To set private data

this.period1C = Period1C;

} // setFirstCourse ()

String getFirstCourse () {// To get private data

Return this period1C;

} // getFirstCourse ()

void setSecondCourse (String period2C) {// To set private data

this.period2C = period2C;

} // setSecondCourse ()

String getSecondCourse () {// To get private data

return this.period2C;

} // getSecondCourse ()

void setThirdCourse (String period3C) {// To set private data

this.period3C = period3C;

} // setThirdCourse ()

String getThirdCourse () {// To get private data

return this.period3C;

} // getThirdCourse ()

void setForthCourse (String period4C) {// To set private data

this.period4C = period4C;

} // setForthCourse ()

String getForthCourse () {// To get private data

return this.period4C;

} // getForthCourse ()

}//Class

Here is my teacher class.

Import java.util.Scanner;

public class teacher expands students {

static scanner input = new scanner (System.in);

// create variables

private string t;
private string departureName;
Private String CourseA;
private string courseB;
private string courseC;

protected static teacher teacher list[] = new teacher[10];

private static student studentListA[] = new student [20];
private static student studentListB[] = new student [20];
private static student studentListC[] = new student [20];

public Teacher () {// Like the default constructor, if it does not exist

this.t = "not available";
this.departName = "Not available";
this.courseA = "Not available";
this.courseB = "Not available";
this.courseC = "Not available";

}//College student()

Teacher (string t, string-name) {// constructor with 2 parameters

this.t = t;
this.departName = departureName;
this.courseA = "Not available";
this.courseB = "Not available";
this.courseC = "Not available";

} // end of constructor 2

// Use of this constructor for option 1 in the main person class

Teacher (string t, string name, stringA, stringB, stringC, teacher)[] Teacher list, student[] studentListA, student[] studentListB, student[] studentListC) {

this.t = t;
this.departName = departureName;
this.courseA = courseA;
this.courseB = courseB;
this.courseC = courseC;
Teacher.teacherList = teacher list;
Teacher.studentListA = studentListA;
Teacher.studentListB = studentListB;
Teacher.studentListC = studentListC;

} // end of the constructor

// --------- setter and getter methods for accessing private data -----

void setTeachersName (String t) {// To set private data

this.t = t;

} // setTeachersName (t)

String getTeachersName () {// To get private data

Return t;

} // getTeachersName ()

void setDepartName (String descName) {// To set private data

this.departName = departureName;

} // setDepartName (departName)

String getDepartName () {// To get private data

return name;

} // getDepartName ()

void setCourseA (String courseA) {// To set private data

this.courseA = courseA;

} // setCourseA (courseA)

String getCourseA () {// To get private data

Return courseA;

} // getCourseA ()

void setCourseB (String courseB) {// To set private data

this.courseB = courseB;

} // setcourseB (courseB)

String getcourseB () {// To get private data

Return course B;

} // getcourseB ()

void setCourseC (String courseC) {// To set private data

this.courseC = courseC;

} // setcourseC (courseC)

String getcourseC () {// To get private data

Return courseC;

} // getcourseC ()

void setTeacherList (Teacher[] Teacher list) {

Teacher.teacherList = teacher list;

} // setTeacherList (teacher list)

Teacher[] getTeacherList () {

Return of teacher list;

} // getTeacherList

void setStudentListA (Student[] studentListA) {// How to set private data

Teacher.studentListA = studentListA;

} // setStudentListA (studentListA)

college student[] getStudentListA () {// to get private data

return Teacher.studentListA;

} // getStudentListA ()

void setStudentListB (Student[] studentListB) {// to set private data

Teacher.studentListB = studentListB;

} // setStudentListB (studentListB)

college student[] getStudentListB () {// How to get private data

return Teacher.studentListB;

} // getStudentListB ()

void setStudentListC (Student[] studentListC) {// How to set private data

Teacher.studentListC = studentListC;

} // setStudentListC (studentListC)

college student[] getStudentListC () {// How to get private data

return Teacher.studentListC;

} // getStudentListC ()

boolean addStudentToClass (String[] Courses, Student Student) {

int index = 0;

String firstName = student.getFirstName ();

boolean isAdded = true;

boolean isListFull = false;

boolean isInList = false;

boolean isComplete = false;

// Add the student in the class while the class is not full

do {

// Is the student already in class?

if (studentListA[index] ! = null && studentListA[index].getFirstName (). equalsIgnoreCase (firstName)) {

// Yes, the student in class

System.out.println ("The student is already in class.");

System.out.println ("");

isInList = true; // true because the teacher is already in class

isListFull = false; // false because the class is not full

// Is there room to accommodate a student in the class?

if (studentListA[index] == null && (courses.equals (courseA))) {

// Add the student to the class

student lista[index] = (Student) student;

isComplete = true; // true because the student has been added

isListFull = false; // false because the class is not full

} // end of inner if

Index ++;

} // end of the outer if

// Is the student already in class?

if (studentListB[index] ! = null && studentListB[index].getFirstName (). equalsIgnoreCase (firstName)) {

// Yes, the student is in class

System.out.println ("The student is already in class.");

System.out.println ("");

isInList = true; // true, because the student is already in class

isListFull = false; // false because the class is not full

// Can I add a student?

if (studentListB[index] == null && (courses.equals (courseB))) {

// add students to class ...

studentListB[index] = (Student) student;

isComplete = true; // true because the teacher was added

isListFull = false; // false because the class is not full

} // end of inner if 2

Index ++;

} // end of outer case 2

// Is the student already in class?

if (studentListC[index] ! = null && studentListC[index].getFirstName (). equalsIgnoreCase (firstName)) {

// Yes, the student is in class

System.out.println ("The student is already in class.");

System.out.println ("");

isInList = true; // true, because the student is already in class

isListFull = false; // false because the class is not full

// Can I add a student?

if (studentListC[index] == null && (courses.equals (courseC))) {

// adding the student to the class ...

studentListC[index] = (Student) student;

isComplete = true; // true because the student has been added

isListFull = false; // false, because the list is not full

} // end of inner if 3

Index ++;

} // end of outer case 3

// end of do, begin during

} while (index <studentListA.length && index <studentListB.length && index <studentListC.length && isComplete == false && isInList == false); {

if (isListFull) {

System.out.println ("The classroom is full of students, can not be added anymore.");

System.out.println ("");

} // end of if

return isAdded;

} // end of the while loop

} // addStudentToClass (Courses, Student)

public void deleteStudent () {

System.out.print ("Which student would you like to remove? Enter a number from 0 to 20:");

int removeStudent = input.nextInt ();

if (removeStudent <20) {

for (int i = 0; i <20; i ++) {

if (studentListA[removeStudent] ! = null && studentListA[i] == studentListA[removeStudent]) {

student lista[removeStudent] = zero;

System.out.println ("The student has been removed.");

System.out.println ("");

} // end of if

if (studentListB[removeStudent] ! = null && studentListB[i] == studentListB[removeStudent]) {

studentListB[removeStudent] = zero;

System.out.println ("The student has been removed.");

System.out.println ("");

} // end of if 2

if (studentListC[removeStudent] ! = null && studentListC[i] == studentListC[removeStudent]) {

studentListC[removeStudent] = zero;

System.out.println ("The student has been removed.");

System.out.println ("");

} // end of if 3

} // end of the for loop

} // end of big if

miscellaneous

System.out.println ("Pupil can not be deleted.");

System.out.println ("");

} // end of else

} // end of deleteStudent ()

// Create a method to output the teacher's and student's courses along with the name of the student and the name of the teacher

public void displayCourseList () {

// Create the variables for the student

String firstName;
String lastName;
String address;
String e-mail;
String phoneNum;
String studentID;

// Display information for the first course

if (courseA! = null) {

System.out.println ("COURSE AND TEACHER INFORMATION");
System.out.println ("-------------------------------");

System.out.println ("course name A:" + courseA); // Show courseA
System.out.println ("Teacher Name:" + getTeachersName ());
System.out.println ("department name:") + getDepartName ());

System.out.println ("");

// Now, to access the student lists and spend them on the console

for (int s = 0; s <20; s ++) {// because every student list contains 20 students

if (studentListA[s] ! = null) {

// Set the variables created above to the element s of this student list

firstName = studentListA[s].getFirstName ();
lastName = studentListA[s].getLastName ();
address = studentListA[s].getAddress ();
email = studentListA[s].getEmail ();
phoneNum = studentListA[s].getPhoneNum ();
studentID = studentListA[s].getstudentID ();

System.out.println ("STUDENT INFORMATION");
System.out.println ("-------------------");

System.out.print ("Name:" + first name)
System.out.println ("" + last name);
System.out.println ("Address:" + address);
System.out.println ("E-Mail:" + E-Mail);
System.out.println ("phone number:" + phoneNum);
System.out.println ("Student ID:" + Student ID);

System.out.println ("");

} // end of inner if

} // end of the for loop

} // end of the outer if

// Display information for the second course

else if (courseB! = null) {

System.out.println ("COURSE AND TEACHER INFORMATION");
System.out.println ("-------------------------------");

System.out.println ("course name A:" + courseB); // Show CourseB
System.out.println ("Teacher Name:" + getTeachersName ());
System.out.println ("department name:") + getDepartName ());

System.out.println ("");

// Now, to access the student lists and spend them on the console

for (int s = 0; s <20; s ++) {// because every student list contains 20 students

if (studentListB[s] ! = null) {

// Set the variables created above to the element s of this student list

firstName = studentListB[s].getFirstName ();
lastName = studentListB[s].getLastName ();
address = studentListB[s].getAddress ();
email = studentListB[s].getEmail ();
phoneNum = studentListB[s].getPhoneNum ();
studentID = studentListB[s].getstudentID ();

System.out.println ("STUDENT INFORMATION");
System.out.println ("-------------------");

System.out.print ("Name:" + first name)
System.out.println ("" + last name);
System.out.println ("Address:" + address);
System.out.println ("E-Mail:" + E-Mail);
System.out.println ("phone number:" + phoneNum);
System.out.println ("Student ID:" + Student ID);

System.out.println ("");

} // end of inner if

} // end of the for loop

} // end of big else if

// Display information for the third course

if (courseA! = null) {

System.out.println ("COURSE AND TEACHER INFORMATION");
System.out.println ("-------------------------------");

System.out.println ("course name A:" + courseC); // Show CourseC
System.out.println ("Teacher Name:" + getTeachersName ());
System.out.println ("department name:") + getDepartName ());

System.out.println ("");

// Now, to access the student lists and spend them on the console

for (int s = 0; s <20; s ++) {// because every student list contains 20 students

if (studentListC[s] ! = null) {

// Set the variables created above to the element s of this student list

firstName = studentListC[s].getFirstName ();
lastName = studentListC[s].getLastName ();
address = studentListC[s].getAddress ();
email = studentListC[s].getEmail ();
phoneNum = studentListC[s].getPhoneNum ();
studentID = studentListC[s].getstudentID ();

System.out.println ("STUDENT INFORMATION");
System.out.println ("-------------------");

System.out.print ("Name:" + first name)
System.out.println ("" + last name);
System.out.println ("Address:" + address);
System.out.println ("E-Mail:" + E-Mail);
System.out.println ("phone number:" + phoneNum);
System.out.println ("Student ID:" + Student ID);

System.out.println ("");

} // end of inner if

} // end of the for loop

} // end of big else if 2

miscellaneous

System.out.println ("Courses can not be displayed.");

System.out.println ("");

} // end of else

} // end of displayCourses ()

}//Class
public headmaster extends teachers {

// create string variables

private string t;

private string departureName;

private string schoolName;

Private teacher teacher list[] = new teacher [10];

public Principal () {// Like the default constructor if it does not exist

this.t = "not available";
this.departName = "Not available";
this.schoolName = "Not available";

} // Principal () (end of constructor 1)

public Principal (String t) {// Constructor with 1 parameter

this.t = t;

} // principal (schoolName) (end of constructor 2)

public principal (string t, stringName) {

this.t = t;

this.departName = departureName;

} // end of the principal (t, departureName)

public principal (string t, string customer name, string school name, teacher)[] Teacher list) {

this.t = t ;;
this.departName = departureName;
this.schoolName = school name;
this.teacherList = teacherList;

} // Principal () (end of constructor 3)

// --------- setter and getter methods for accessing private data -----

void setT (String t) {

this.t = t;

} // setT (t)

String getT () {

Return t;

} // getT (t)

void setDepartName (stringName) {

this.departName = departureName;

} // setDepartName (departName)

String getDepartName () {

return name;

} // getDepartName ()

void setSchoolName (String schoolName) {// To set private data

this.schoolName = school name;

} // setSchoolName (school name)

String getSchoolName () {// To get private data

return this.schoolName;

} // getSchoolName ()

void setTeacherList (Teacher[] teacherList) {// How to set private data

this.teacherList = teacherList;

} // setTeacherList (teacher list)

Teacher[] getTeacherList () {// To get private data

return.TeacherList return;

} // getTeacherList ()

// Adding a teacher to the school method

boolean addTeacherToSchool (teacher teacher) {

int index = 0;

String t = teacher.getTeachersName ();

boolean isAdded = true;

boolean isListFull = false;

boolean isInList = false;

boolean isComplete = false;

// Add teachers to the school while the school is not full

do {

// Is the teacher at school?

if (teacher list[index] ! = null && teacherList[index].getTeachersName (). equalsIgnoreCase (t)) {

// Yes. The teacher is in the list

System.out.println ("The teacher is already at school.");

System.out.println ("");

isInList = true; // true, because the teacher is already in the list

isListFull = false; // false, because the list is not full

} // end of if

// Is there room to add?

otherwise if (teacher list[index] == null) {

// adding the teacher to the list ...

list of teachers[index] = Teacher (teacher); // Add

isComplete = true; // true because the teacher was added

isListFull = false; // false, because the list is not full

} // end of else if

Index ++;

// end of do, start during

} while (index <teacherList.length && isComplete == false && isInList == false); {// That keeps the loop ...

if (isListFull) {

System.out.println ("The school is full of teachers, it can not be added anymore.");

} // end of if

return isAdded;

} // end of the while loop

} // addTeacherToSchool (t)

// Create a method to remove a teacher

public void deleteTeacher () {

System.out.print ("Which teacher would you like to remove? Enter a number between 0 and 10:");

int removeTeacher = input.nextInt ();

if (removeTeacher <10) {

for (int i = 0; i <10; i ++) {

if (teacher list[removeTeacher] ! = null && teacherList[i] == teachers list[removeTeacher]) {

list of teachers[removeTeacher] = zero;

System.out.println ("The teacher has been removed.");

System.out.println ("");

} // end of inner if

} // end of the for loop

} // end of the outer if

miscellaneous

System.out.println ("Teacher can not be deleted.");

} // end of else

} // delete (teacher list)

// Create a method to display the teacher using a for loop

void displayTeacherList () {

String t;
String departureName;

System.out.println ("TEACHER LIST");
System.out.println ("------------");

for (int i = 0; i <10; i ++) {

if (teacher list[i] ! = null) {

t = teacher list[i].getTeachersName ();
departName = teacher list[i].getDepartName ();

System.out.println ("teacher's name:" + t);
System.out.println ("department name" + department name);

System.out.println ("");

} // end of if

} // end of the for loop

} // end of displayTeacherList ()

// Method for displaying the price page in the class Teacher

void displayCourses () {

for (int i = 0; i <10; i ++) {

if (teacher list[i] ! = null) {

System.out.println ("");

list of teachers[i].displayCourseList (); // View the price page in TEACHER

} // end of if

} // end of the for loop

} // end of displayAll (teachers list)

}//Class

Here's a snippet of code I used to add a student in the Teacher class, but it did not work, so I removed it.

boolean addStudentToClass (String[] Courses, Student Student) {

boolean add = false;

for (int i = 0; i <teacherList.length; i ++) {

if (teacher list[i] ! = null && add == false) {

Principal teacherFound = (Principal) teacherList[i]; // The teacher was found

if (teacherFound.getFirstCourse ()! = null && teacherFound.getFirstCourse (). equals (courses.)[0])) {

if (addStudentToClass (Courses, Student)) {

System.out.println ("The student has been added to the course.");

add = true;

} // end of inner if 2

} // end of inner if

else if (teacherFound.getSecondCourse ()! = null && teacherFound.getSecondCourse (). equals (Courses[1])) {

if (addStudentToClass (Courses, Student)) {

System.out.println ("The student has been added to the course.");

add = true;

} // end of inner if 3

} // end of else if

else if (teacherFound.getThirdCourse ()! = null && teacherFound.getThirdCourse (). equals (Courses[2])) {

if (addStudentToClass (Courses, Student)) {

System.out.println ("Der Student wurde dem Kurs hinzugefügt.");

add = wahr;

} // Ende von inner wenn 4

} // Ende von else if 2

else if (teacherFound.getForthCourse ()! = null && teacherFound.getForthCourse (). gleich (Kurse.)[4])) {

if (addStudentToClass (Kurse, Student)) {

System.out.println ("Der Student wurde dem Kurs hinzugefügt.");

add = wahr;

} // Ende von inner if 5

} // Ende von else if 3

miscellaneous

System.out.println ("Kurs ist nicht verfügbar.");

} // Ende von else

} // Ende von big if

} // Ende der for-Schleife

if (courses.equals (courseA)) {

add = isCourseFull (studentListA, student); // Schüler zur Schülerliste A für Kurs A hinzufügen

} // Ende von if

else if (courses.equals (courseB)) {

add = isCourseFull (studentListB, student); // Schüler zu Schülerliste B für Kurs B hinzufügen

} // Ende von else if

else if (courses.equals (courseC)) {

add = isCourseFull (studentListC, student); // Schüler zur Schülerliste C für Kurs C hinzufügen

} // Ende von else if 2

miscellaneous

System.out.println ("Student kann der Klasse nicht hinzugefügt werden.");

System.out.println ("");

} // Ende von else

return add = wahr;

} // Ende von addStudentToClass (Kurse, Student)

  // Erstellen Sie eine Methode, um zu überprüfen, ob der Kurs / die Klasse voll ist oder nicht, und fügen Sie dann hinzu, wenn er nicht voll ist

  statisch boolean isCourseFull (Student[] Kurs, Student Student) {

  boolean isAdded = true;

  int index = 0;

  // Schüler dem Unterricht hinzufügen, während der Kurs nicht voll ist

do {

if (studentListA[index] == null) {

studentListA[index] = (Student) Student;

isAdded = true; // Der Kurs ist nicht voll

} // Ende von if

else if (studentListB[index] == null) {

studentListB[index] = (Student) Student;

} // Ende von else if

miscellaneous

studentListC[index] = (Student) Student;

} // Ende von else

Index ++; // Schüler hinzufügen ...

} // Ende von do

while (studentListA[index] ! = null && index <course.length); {

return isAdded; // Der Kurs ist voll

} // Ende der Weile

} // isCourseFull (Kurs, Student)