Question: PLEASE WRITE IN JAVA Write a class named Bill with the following specifications: - The class contains three fields, one of type int named number,

PLEASE WRITE IN JAVA PLEASE WRITE IN JAVA Write a class named Bill with the following

Write a class named Bill with the following specifications: - The class contains three fields, one of type int named number, one of type String named name, and one of type double named amount. - The class contains one constructor which has parameters for all fields. The constructor should set the values of the fields to the values passed to its parameters. - The class should contain another constructor which has only one parameter for the name field. The constructor should set the value of the name field to the value passed to its parameter. The constructor should set the number field to 999. The constructor should set the value of the amount field to 0.0. - The class contains get and set methods for each field. - The class contains a toString() method that returns a String that contains information about the value of all fields. Double values should be rounded to two decimal places. - The class contains a method named calculateTax with return type double and one parameter of type double named percentage. The method should return the value of the amount field multiplied by the value of percentage. Write another class named TestBill with the following specifications: - The class contains a main() method. - The class creates two Bill objects each using a different constructor. - The class uses two System.out.printin() statements to print the objects without using the get methods. - The class should call the calculatefax method for both objects and print the results to the screen. Late Submissions Policy: Problems not submitted by the deadline will be penalized by 10% with an additional 10% penalty added for each 24 hour period elapsed between the original deadline and time of submission

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!