120k views
1 vote
Write a method for the Customer class that that will return a string representing a bill notice when passed a double value representing an amount due. For example, if the customer has name "Jeremiah", has account number 3, and has amount due 50.50, the method should return a string in the following format. Jeremiah, account number 3, please pay $50.50 Write the method below. Your implementation must conform to the example above.

User Yaks
by
4.4k points

1 Answer

5 votes

Answer:

Following are the method definition to this question:

public String notice_bill(double amount) //defining method

{

return this.name+", account number "+this.currAccNum+", please pay $"+amt; //return value.

}

Step-by-step explanation:

In the given question some information is missing, that is example So, method definition to this question can be described as follows:

  • In the above method definition a string method "notice_bill" is declared, which accepts a double value in its parameter, that is "amount".
  • Inside the method, this keyword is used, that hold values and return its value as a message.
User Jeff Breadner
by
4.1k points