java/netbeans
1.Design an abstract class Employee that stores: employee name, unique auto-generated id, hire year. Implement any necessary methods in addition to:
a.The toString and equals methods. The equals method should NOT compare the id.
b.The copy constructor (should copy the same id too)
c.An abstract method float getWeeklyCheckAmount()
d.Implement the appropriate interface to be able to sort employee names in alphabetical order. Subclasses should NOT be allowed to override this implementation.
2.Design an abstract class HourlyWorker that extends Employee and stores: hourly rate and number of hours worked a week. Implement any needed methods.
3.Design an abstract class SalariedWorker that extends Employee and stores: annual salary. Implement any needed methods.
4.Design a class Secretary that extends HourlyWorker and stores: weekly bonus. Implement any needed methods.
5.Design a class SalesWorker that extends HourlyWorker and stores: number of sales made and commission amount per sale. Implement any needed methods.
6.Design a class Manager that extends SalariedWorker and stores a list of Employees being managed.
7.Write a main method that:
a.Asks the user for the name of the Manager, hire year, annual salary and creates one.
b.Asks the user for the number of employees managed. For each employee, ask if it is a Secretary or a SalesWorker. Ask for the appropriate information. Add the employee to the list of Employees stored in the Manager.
c.Repeat the above steps for a second manager.
d.Print whether the 2 Manager objects are equal.
e.For the first Manager, print the Secretaries first and then the SalesWorkers.
f.Print all Employees for the first Manager in alphabetical order.
g.Print all the Employees for the first Manager according to their weekly check amount using the comparator interface.
Print all Employees for the first Manager in ascending order of hire year using lambda expressions
In: Computer Science
Abstraction is the basis for good Object-Oriented design that is modular, reusable, and maintainable.
Interfaces and Abstract classes are two mechanisms in Java that provide high-level abstractions. An interface or abstract class is something which is not concrete, something which is incomplete.
For this discussion, what do you think is meant by “Programming to an interface”? What are some differences between Abstract Classes and Interfaces? Provide a simple example application with an interface definition and a class which implements the interface.
In: Computer Science
please, solve this problem.:
implementing with java language
create a bank account management system according to the following specifications:
BankAccount Abstract Class contains the following constructors and methods:
BankAccount(name, balance): a constructor that creates a new account with a name and starting balance.
getBalance(): a method that returns the balance of a specific account.
abstract deposit(amount): abstract method to be implemented in both Checking and SavingAccount classes.
abstract withdraw(amount): abstract method to be implemented in both Checking and SavingAccount classes.
messageTo Client (message): used to print a specific message to a client.
toString(): a method for printing accounts information.
CheckingAccount Class: A class that inherits from the Abstract Class BankAccount and implements both deposit () and withdraw ().
Deposit process in checking account has some constrains. Client can deposit any amount using checks and limit of $10,000.00 of cash deposit.
Client can withdraw any amount he wants.
SavingAccount Class: A class that inherits from the Abstract Class BankAccount and implements both deposit () and withdraw ().
A client can deposit any amount using checks and a limit of $5,000.00 of cash deposit. A 5% interest should be calculated on the total.
Client can only withdraw 20% of the total balance every 3 months.
Use interfaces for both checkingAccount and savingAccount classes.
BankAccountDriver class: this class is to test your code. The test should be done by creating an array of type BankAccount that stores different bank accounts types for different clients and perform some processing by calling the implemented methods on these accounts.
In: Computer Science
Java - Write an abstract class called Shape with a string data field called colour. Write a getter and setter for colour. Write a constructor that takes colour as the only argument. Write an abstract method called getArea()
In: Computer Science
In: Biology
This violates Liskov Substitution Principle (LSP), can someone explain why and refactor it so it does not?
public abstract class Bird
{
public abstract void LayEgg();
public abstract void FlyAway();
}
public class Penguin : Bird
{
public override void LayEgg()
{
//Make husband penguin do all the incubation work.
}
public override void FlyAway()
{
//Penguins can't fly.
throw new NotImplementedException();
}
public void SwimAway()
{
//Swimming is way more fun.
}
}In: Computer Science
What can parents do to increase a child’s social cognitive skills and foster moral maturity? Your answers need to be specific and reflect the capabilities of the child's stage of development. (For example, you cannot expect a 6 year old to be able to construct hypothetical and abstract thought.)
In: Psychology
In: Statistics and Probability
Create a short program in Java which contains the below information:
- Has one abstract and two regular classes
- Has two interfaces (the two regular classes have to implement at least one interface
- At least one regular class must implement both interfaces
- The two classes have to extend the abstract class
- The abstract class must have a method
- At least one interface must have a method
- At least two fields in each class, this includes the superclass
- All the fields are instantiated within the constructor
In: Computer Science
Select one of the choices below:
A mental model of the behavior of a function or algorithm is called a(n):
A: Abstract data type
B: Abstract data type implementation
C: Data abstraction
D: Encapsulation
E: Function Declaration
F: None of the above
In: Computer Science