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

The Homework Writings
Order NOW For A 10% Discount!
Pages (550 words)
Approximate price: -

Our Advantages

Plagiarism Free Papers

All our papers are original and written from scratch. We will email you a plagiarism report alongside your completed paper once done.

Free Revisions

All papers are submitted ahead of time. We do this to allow you time to point out any area you would need revision on, and help you for free.


A title page preceeds all your paper content. Here, you put all your personal information and this we give out for free.


Without a reference/bibliography page, any academic paper is incomplete and doesnt qualify for grading. We also offer this for free.

Originality & Security

At, we take confidentiality seriously and all your personal information is stored safely and do not share it with third parties for any reasons whatsoever. Our work is original and we send plagiarism reports alongside every paper.

24/7 Customer Support

Our agents are online 24/7. Feel free to contact us through email or talk to our live agents.

Try it now!

Calculate the price of your order

We'll send you the first draft for approval by at
Total price:

How it works?

Follow these simple steps to get your paper done

Place your order

Fill in the order form and provide all details of your assignment.

Proceed with the payment

Choose the payment system that suits you most.

Receive the final file

Once your paper is ready, we will email it to you.

Our Services

We work around the clock to see best customer experience.


Flexible Pricing

Our prices are pocket friendly and you can do partial payments. When that is not enough, we have a free enquiry service.


Admission help & Client-Writer Contact

When you need to elaborate something further to your writer, we provide that button.


Paper Submission

We take deadlines seriously and our papers are submitted ahead of time. We are happy to assist you in case of any adjustments needed.


Customer Feedback

Your feedback, good or bad is of great concern to us and we take it very seriously. We are, therefore, constantly adjusting our policies to ensure best customer/writer experience.