Im trying to draw a diagram for the following problem


I'm trying to draw a diagram for the following problem statement. I need to create the function in JavaScript and call it in an HTML file.

"An invoice consists of a customer, a list of line items, and a date of purchase. Customers have contact names, addresses, telephone numbers, and an internal customer ID. Line items consist of an item and a quantity. Items have a description and a price."

For each object identified in the above, write a constructor. Also, create two methods that act on invoices. One should be addLineItem that adds a line item to an existing invoice. The other should calculateTotal that determines the total billing price of the invoice.

Here is what I have so far:

function invoice(customer, lineItems, dateOfPurchase){
this.customer = customer;
this.lineItems = lineItems;
this.dateOfPurchase = dateOfPurchase;
}

customer = contact names("Mike");
customer = address(1234 main st);
customer = telephone number (222-111-3333);
custimer = internal id (12345);

Solution Preview :

Prepared by a verified Expert
Programming Languages: Im trying to draw a diagram for the following problem
Reference No:- TGS01244862

Now Priced at $20 (50% Discount)

Recommended (90%)

Rated (4.3/5)