Question
Write a java program that implements Invoice class and the related classes shown in the UML diagram. Then, test your code by generating the required
Write a java program that implements Invoice class and the related classes shown in the UML diagram. Then, test your code by generating the required object(s) int the main Method to print the invoice below (see Note 2).
Note 1: Feel free to add (enhance the classes with) utility methods as needed. For example, if you feel that adding more methods to the class will make the program (and its potential tests) more efficient, please do. (Hint: are we able to update the Objects data (fields values) after its created by its constructor? What would be the method (s) to allow updating the data by the program?).
Note 2: Try to build the project in an incremental fashion. That is, create the classes one by one and test them individually. (Hint: Witch class (s) should be implemented first? That is, is there a class that contained members that are objects (instances) of another class (s).
Program requirements: The task of this program is to print out an invoice. An invoice describes the charges for a set of products in certain quantities. The program simply prints the billing address, all line items, and the amount due. Each line item contains the description and unit price of a product, the quantity ordered, and the total price.
Amount Due: $154.78 UML diagram for the potential classes used in this project. Notice that (according to the note above) you can add more methods if needed. \begin{tabular}{|l|} \hline Product \\ \hline -description:String \\ -price:double \\ \hline +Product(desc:String, price:double) \\ +getDescription()=String \\ +getPrice():double \\ \hline \end{tabular}Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started