Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package bankcharge;
- /**
- *
- * @author Charters
- */
- public class BankCharge
- {
- private String firstName;
- private String lastName;
- private String monthName;
- private int numberOfChecks;
- private double monthlyServiceFee;
- //create a constructor for BankCharge here:
- public BankCharge(String aFirstName, String aLastName, String aMonthName, int aNumOfChecks)
- {
- firstName = aFirstName;
- lastName = aLastName;
- monthName = aMonthName;
- numberOfChecks = aNumOfChecks;
- monthlyServiceFee = 0;
- }
- //create all the getters for the attributes here:
- public String getfirstName()
- {
- return firstName;
- }
- public String getlastName()
- {
- return lastName;
- }
- public String getmonthName()
- {
- return monthName;
- }
- public int getnumberOfChecks()
- {
- return numberOfChecks;
- }
- public double getmonthlyServiceFee()
- {
- return monthlyServiceFee;
- }
- //create all the setters for the attributes here:
- public void setfirstName(String aFirstName)
- {
- firstName = aFirstName;
- }
- public void setlastName(String aLastName)
- {
- lastName = aLastName;
- }
- public void setmonthName(String aMonthName)
- {
- monthName = aMonthName;
- }
- public void setnumberOfChecks(int aNumOfChecks)
- {
- numberOfChecks = aNumOfChecks;
- }
- public void setmonthlyServiceFee(double aMonthlyServiceFee)
- {
- monthlyServiceFee = aMonthlyServiceFee;
- }
- //create the .toString() method here:
- public String toString()
- {
- return("For the month of " + monthName + ", " + firstName + " " + lastName +" will write " + numberOfChecks + " number of checks and will be charged " + monthlyServiceFee + " fees.");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement