Question: Please do in Java Provide code and screenshot please :) Problem Statement Implement the class Bill based on the class diagram and description given below.



Problem Statement Implement the class Bill based on the class diagram and description given below. Bill counter: int billid: String o payment Mode: String Bill payment Moder String) getBild: String setBillid(billld: String): void .getPayment Mode(): String setPayment Mode(payment Mode: String) void getCounter(); int A Method Description Bill(String payment Mode) Initialize the paymentMode instance variable with the value passed to the parameter . Generate the billid using counter. The value of bullid should start from 'B9001' and the numerical part should be incremented by 1 for the subsequent values. Initialize the counter in static block. Implement the appropriate getter and setter methods. Test the functionalities using the provided Tester class. Create two or more Bill objects and validate that the billid is being generated properly. Sample Input and Output For constructor Input For first Bill object Parameters Values payment Mode DebitCard For second Bill object Values Parameters paymentMode PayPal Output Bill Details Bill Id: B9001 Payment method: Debitcard Bill Details Bill Id: B9002 Payment method: PayPal 1-class Bill 2 7/Implement your code here 3 } 4 5-class Tester { 6 public static void main(String[args) { 7 8 Bill billi = new Bill ("Debitcard"); 9 Bill bill2 = new Bill("PayPal"); 10 11 /Create more objects and add them to the bills array for testing your code 12 13 Bill[] bills = ( billi, bil12 }; 14 15 - for (Bill bill : bills) 16 System.out.println("Bill Details"); 17 System.out.println("B11 Id: " + bill.getBillid(); 18 System.out.println("Payment method: " + bill.getPayment Mode()); 19 System.out.println(); 3 20 > 22
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
