package cheggjan20public class BasePlusCommissionEmployee int employeeID String Essay

package cheggjan20;public class BasePlusCommissionEmployee { int employeeID; String firstName; String lastName; double baseSalary; int grossSales; double commisionRate; //parameterised constructors BasePlusCommissionEmployee(int employeeID,String firstName,String lastName) { if(employeeID>0) {this.employeeID=employeeID;} if(firstName!=null) {this.firstName=firstName;} if(lastName!=null) {this.lastName=lastName;} } BasePlusCommissionEmployee(int employeeID,String firstName,String lastName,double baseSalary,int grossSales,double commisionRate) { if(employeeID>0) {this.employeeID=employeeID;} if(firstName!=null) {this.firstName=firstName;} if(lastName!=null) {this.lastName=lastName;} if(commisionRate>=0.1 && commisionRate0) { this.baseSalary = baseSalary; } else this.

baseSalary=200.00; if(grossSales!=0) this.grossSales = grossSales; } //getters and setters public int getEmployeeID() { return employeeID; } public int getGrossSales() { return grossSales; } public void setGrossSales(int grossSales) { if(grossSales!=0) this.grossSales = grossSales; } public double getCommisionRate() { return commisionRate; } public void setCommisionRate(int commisionRate) { if(commisionRate>=0.1 && commisionRate0) { this.employeeID = employeeID; }} public void setFirstName(String firstName) { if(firstName!=null) { this.firstName = firstName; } } public void setLastName(String lastName) { if(lastName!=null) { this.lastName = lastName; } } public void setBaseSalary(double baseSalary) { if(baseSalary>0) { this.baseSalary = baseSalary; } else this.baseSalary=200.00; } public String getFirstName() { return firstName; } public String getLastName() { return lastName; } public double getBaseSalary() { return baseSalary; } public double earnings()//to calculate earnings { return commisionRate*grossSales+baseSalary; } public String toString()//to print details { return “nEmployee Id : “+employeeID+”nFirst Name: “+firstName+”nLast Name : “+lastName+”nBase Salary : $”+baseSalary+”nGross Sales : $”+grossSales+”nCommision Rate : “+commisionRate+”%”; } }BasePlusCommissionEmployeeTest.javapackage cheggjan20;public class BasePlusCommissionEmployeeTest { public static void main(String[] args) { // TODO Auto-generated method stub //creating objects BasePlusCommissionEmployee e1=new BasePlusCommissionEmployee(121,”Nick”,”Jonas”,30000,300,20); BasePlusCommissionEmployee e2=new BasePlusCommissionEmployee(123,”Priyanka”,”Jonas”,40000,400,20); //displaying details System.out.println(e1); System.out.println(“Total Commision : $”+e1.earnings()); System.out.println(e2); System.out.println(“Total Commision : $”+e2.earnings()); }}Output is :Employee Id : 121First Name: NickLast Name : JonasBase Salary : $30000.0Gross Sales : $300Commision Rate : 0.1%Total Commision :30030.0Employee Id : 123First Name: PriyankaLast Name : JonasBase Salary : $40000.0Gross Sales : $400Commision Rate : 0.1%Total Commision :40040.0CheckingAccount.javapackage cheggjan20;public class CheckingAccount { int accountNumber; String customerName; double accountBalance; //parameterised constructor CheckingAccount(int ac,String cname,double balance) { accountNumber=ac; customerName=cname; accountBalance=balance; } //getters and setters public int getAccountNumber() { return accountNumber; } public String getCustomerName() { return customerName; } public double getAccountBalance() { return accountBalance; } public void setAccountBalance(double accountBalance) { if(accountBalance>50.00)//it should always be greater than that this.accountBalance = accountBalance; } public double withdraw (double amount)//to withdraw ammount and return balance { if((accountBalance-amount-2)>=50.00) accountBalance=accountBalance-amount-2; return accountBalance; } public String toString()//to display details { return “Account Number : “+accountNumber+”nCustomer Name : “+customerName+”nAccount Balance : $”+accountBalance; } }CheckingAccountTest.javapackage cheggjan20;public class CheckingAccountTest { public static void main(String args[]) {//creating objects CheckingAccount c1=new CheckingAccount(121,”Nick”,600.00); CheckingAccount c2=new CheckingAccount(122,”Nickos”,700.00); //displaying details System.out.println(c1); System.out.println(“Balance after withdrawl of $200 is : $”+c1.withdraw(200)); System.out.println(c2); System.out.println(“Balance after withdrawl of $400 is : $”+c2.withdraw(400)); }}

Don't use plagiarized sources. Get Your Custom Essay on
package cheggjan20public class BasePlusCommissionEmployee int employeeID String Essay
From as low as $9/Page
Order Essay

How to place an order?

Take a few steps to place an order on our site:

  • Fill out the form and state the deadline.
  • Calculate the price of your order and pay for it with your credit card.
  • When the order is placed, we select a suitable writer to complete it based on your requirements.
  • Stay in contact with the writer and discuss vital details of research.
  • Download a preview of the research paper. Satisfied with the outcome? Press “Approve.”

Feel secure when using our service

It's important for every customer to feel safe. Thus, at The Homework Writings, we take care of your security.

Financial security You can safely pay for your order using secure payment systems.
Personal security Any personal information about our customers is private. No other person can get access to it.
Academic security To deliver no-plagiarism samples, we use a specially-designed software to check every finished paper.
Web security This website is protected from illegal breaks. We constantly update our privacy management.

Get assistance with placing your order. Clarify any questions about our services. Contact our support team. They are available 24\7.

Still thinking about where to hire experienced authors and how to boost your grades? Place your order on our website and get help with any paper you need. We’ll meet your expectations.

Order now Get a quote