Question: Create the following in java : Create the following: 1 . Class Invoice ( the node ) that includes four instance variables: int No; /
"Create the following in java
:
Create the following:
Class Invoice the node that includes four instance variables:
int No; the Invoice No
String CustName; the Customer name
int Amount; the Invoice Amount
char Status; the Invoice status P paid N not paid
Invoice next; to the next Invoice
Default and overloaded constructors
Class Shop that includes two instance variables:
Invoice head;
Invoice Tail;
Your class should have the following:
A method that initializes the instance variables.
void add int String, int, char creates and adds the Invoice information No CustName, Amount and Status in the singly linked list.
void printAllInvoices prints all the Invoices in the single linked list.
void printPInvoices prints all the paid Invoices in the single linked list based on the status of an invoice
int countAllInvoices counts the number of Invoices in the list.
int countPInvoices counts all the paid Invoices in the list based on the status of an invoice
Write a test application. In the main method, do the following:
Create a Shop object.
Ask the user to enter the number of Invoices in the Shop.
Input the No CustName, Amount and status of each Invoice and add it to the Shop class Hint: Use a loop
Print all Invoices.
Print all paid Invoices.
Print the number of all Invoices.
Print the number of all paid Invoices in the list."PN
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
