Write a java program that has: A class University that has: - Three private instance variables named firstName, lastName, and id - A constructor to initialize the three instance variables - A toString method to return: “Welcome,” + firstName +” “ + lastName + “Your ID is ” + id - Accessors A subclass Employee that has: - Five additional private instance variables named department, rate, bonus, hours, and salary - An appropriate constructor to use constructor of superclass in defining those of the subclass - A method named compteSalary ( ) to return salary - A method named computeBonus ( ) to return bonus - Accessors A subclass Staff that: - Overrides computeBonus ( ) such that if hours are greater than 40, there will be %10 bonus for each additional hour added to salary - Overrides compteSalary ( ) such that salary = (rate * hours) + bonus - Overrides toString method to add department and salary into the output A subclass Faculty that: - Overrides computeBonus ( ) such that if hours are greater than 40, there will be %25 bonus for each additional hour added to salary - Overrides compteSalary ( ) such that salary = (rate * hours) + bonus - Overrides toString method to add department and salary into the output A subclass Student that has: - Three additional private instance variables major, level, and grade - An appropriate constructor to use constructor of superclass in defining those of the subclass - One instance method computeGrade( ) to return the grade - Overrides toString method to add major and level into the output - Accessors A subclass Undergrade that has: - Three additional private instance variables named course1, course2, and course3 as double - An appropriate constructor to use constructor of superclass in defining those of the subclass - Overrides computeGade( ) such that grade = [(course1 + course2+ course3) / 300 ] * 100 - Overrides toString method to add grade into the output - Accessors A TestUniv class that has: - The main function to run your code. - Create objects to show two different outputs like: Output 1: Welcome, Ahmed Abdullah. Your ID is 123456 Your department is Computer Science and Engineering Your salary for this month is 10,000

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Write a java program that has:
A class University that has:
- Three private instance variables named firstName, lastName, and id
- A constructor to initialize the three instance variables
- A toString method to return: “Welcome,” + firstName +” “ + lastName + “Your ID is ” + id
- Accessors
A subclass Employee that has:
- Five additional private instance variables named department, rate, bonus, hours, and salary
- An appropriate constructor to use constructor of superclass in defining those of the subclass
- A method named compteSalary ( ) to return salary
- A method named computeBonus ( ) to return bonus
- Accessors

A subclass Staff that:
- Overrides computeBonus ( ) such that if hours are greater than 40, there will be %10 bonus for each additional hour
added to salary
- Overrides compteSalary ( ) such that salary = (rate * hours) + bonus
- Overrides toString method to add department and salary into the output
A subclass Faculty that:
- Overrides computeBonus ( ) such that if hours are greater than 40, there will be %25 bonus for each additional hour
added to salary
- Overrides compteSalary ( ) such that salary = (rate * hours) + bonus
- Overrides toString method to add department and salary into the output
A subclass Student that has:
- Three additional private instance variables major, level, and grade
- An appropriate constructor to use constructor of superclass in defining those of the subclass
- One instance method computeGrade( ) to return the grade
- Overrides toString method to add major and level into the output
- Accessors
A subclass Undergrade that has:
- Three additional private instance variables named course1, course2, and course3 as double
- An appropriate constructor to use constructor of superclass in defining those of the subclass
- Overrides computeGade( ) such that grade = [(course1 + course2+ course3) / 300 ] * 100
- Overrides toString method to add grade into the output
- Accessors
A TestUniv class that has:
- The main function to run your code.
- Create objects to show two different outputs like:
Output 1:
Welcome, Ahmed Abdullah. Your ID is 123456
Your department is Computer Science and Engineering
Your salary for this month is 10,000

Expert Solution
Step 1

As per the given question, we need to create classes University, Employee, Staff, Faculty, Student, Undergrade, and TestUniv(This class tests the working of the remaining classes).

Attributes and methods of University class:

Attributes:

  • firstName
  • lastName
  • id

Methods:

  • Constructor
  • Accessor methods i.e getter methods
  • toString()

Attributes and methods of Employee class:

Attributes:

  • firstName
  • lastName
  • id
  • department
  • rate
  • bonus
  • hours
  • salary

Methods:

  • Constructor
  • Accessor methods i.e getter methods
  • toString()
  • compteSalary
  • computeBonus

Attributes and methods of Staff class:

Attributes:

  • firstName
  • lastName
  • id
  • department
  • rate
  • bonus
  • hours
  • salary

Methods:

  • Constructor
  • toString()
  • compteSalary
  • computeBonus

Attributes and methods of Faculty class:

Attributes:

  • firstName
  • lastName
  • id
  • department
  • rate
  • bonus
  • hours
  • salary

Methods:

  • Constructor
  • toString()
  • compteSalary
  • computeBonus

Attributes and methods of Student class:

Attributes:

  • firstName
  • lastName
  • id
  • major
  • level
  • grade

Methods:

  • Constructor
  • toString()
  • computeGrade
  • Accessor methods

Attributes and methods of Undergrade class:

Attributes:

  • firstName
  • lastName
  • id
  • major
  • level
  • grade
  • course1
  • course2
  • course3

Methods:

  • Constructor
  • toString()
  • computeGrade
  • Accessor methods

 

steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
Reference Types in Function
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-engineering and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY