Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Invoice Class This abstract class contains functionality that supports the business process of creating an invoice. Create the Invoice class in the Library project. This

image text in transcribed

Invoice Class

This abstract class contains functionality that supports the business process of creating an invoice.

Create the Invoice class in the Library project. This class must be defined under the my.Business namespace.

Fields

provincialSalesTaxRate : decimal - The provincial sales tax rate applied to the invoice.

goodsAndServicesTaxRate : decimal - The goods and services tax rate applied to the invoice.

Properties

ProvincialSalesTaxRate : decimal

Gets and sets the provincial sales tax rate.

Exceptions:

  • ArgumentOutOfRangeException - When the property is set to less than 0. Message: The value cannot be less than 0. Parameter name: "value".
  • ArgumentOutOfRangeException - When the property is set to greater than 1. Message: The value cannot be greater than 1. Parameter name: "value".

GoodsAndServicesTaxRate : decimal

Gets and sets the goods and services tax rate.

Exceptions:

  • ArgumentOutOfRangeException - When the property is set to less than 0. Message: The value cannot be less than 0. Parameter name: "value".
  • ArgumentOutOfRangeException - When the property is set to greater than 1. Message: The value cannot be greater than 1. Parameter name: "value".

ProvincialSalesTaxCharged : decimal (Abstract)

Gets the amount of provincial sales tax charged to the customer.

GoodsAndServicesTaxCharged : decimal (Abstract)

Gets the amount of goods and services tax charged to the customer.

SubTotal : decimal (Abstract)

Gets the subtotal of the Invoice.

Total : decimal

Gets the total of the Invoice (Subtotal + Taxes).

Methods

Invoice(decimal, decimal)

Initializes an instance of Invoice with a provincial and goods and services tax rates.

Parameters:

  • provincialSalesTaxRate - The rate of provincial tax charged to a customer.
  • goodsAndServicesTaxRate - The rate of goods and services tax charged to a customer.

Exceptions:

  • ArgumentOutOfRangeException - When the provincial sales tax rate is less than 0. Message: The argument cannot be less than 0. Parameter name: "provincialSalesTaxRate".
  • ArgumentOutOfRangeException - When the provincial sales tax rate is greater than 1. Message: The argument cannot be greater than 1. Parameter name: "provincialSalesTaxRate".
  • ArgumentOutOfRangeException - When the goods and services tax rate is less than 0. Message: The argument cannot be less than 0. Parameter name: "goodsAndServicesTaxRate".
  • ArgumentOutOfRangeException - When the goods and services tax rate is greater than 1. Message: The argument cannot be greater than 1. Parameter name: "goodsAndServicesTaxRate".
Sales Quote -vehicle Sale Price: decimal -tradelnAmount: decimal -sales Tax Rate : decimal -accessoriesChosen : Accessories -exteriorFinishChosen : ExteriorFinish > +VehicleSale Price : decimal > +TradeInAmount: decimal > +AccessoriesChosen : Accessories > +Exterior FinishChosen : ExteriorFinish > > +Accessory Cost: decimal > > +FinishCost: decimal > > +SubTotal: decimal > > +SalesTax : decimal > > +Total : decimal > > +AmountDue : decimal +Sales Quote(vehicleSale Price : decimal, tradelnAmount : decimal, sales TaxRate : decimal, accessoriesChosen : Accessories, exterior FinishChosen : ExteriorFinish) +Sales Quote(vehicleSale Price : decimal, tradelnAmount : decimal, sales TaxRate : decimal) > > V > ExteriorFinish > Accessories Invoice -provincialSalesTax Rate : decimal -goodsAndServices Tax Rate : decimal > + ProvincialSales Tax Rate : decimal > +GoodsAndServices Tax Rate : decimal |> > +ProvincialSalesTaxCharged: decimal > > +GoodsAndServices TaxCharged: decimal > > +SubTotal : decimal > > +Total : decimal +Invoice(provincial Sales TaxRate : decimal, goodsAndServicesTax Rate : decimal) The ProvincialSalesTaxChanged, GoodsAndServices Tax Charged, and SubTotal properties are all abstract. This diagramming tool can not represent properties as abstract. > Cost Type Labour Part Material Servicelnvoice > > +LabourCost : decimal > > +Parts Cost : decimal > > +MaterialCost : decimal > > +ProvincialSalesTaxCharged: decimal > > +GoodsAndServicesTaxCharged: decimal > > +SubTotal : decimal > > +Total : decimal +Servicelnvoice(provincialTax Rate : decimal, goodsAndServices Tax Rate : decimal) +AddCost(type: Cost Type, amount : decimal) CarWashinvoice -packageCost : decimal -fragranceCost : decimal > +PackageCost : decimal > +FragranceCost : decimal > > +ProvincialSalesTaxCharged: decimal > > +GoodsAndServicesTaxCharged: decimal > > +SubTotal : decimal > > +Total : decimal +CarWashInvoice(provincialSales TaxRate : decimal, goodsAndServices TaxRate : decimal) +CarWashInvoice provincialSales TaxRate: decimal, goodsAndService TaxRate : decimal, packageCost: decimal, fragranceCost : decimal) > > Financial +GetPayment(rate : decimal, numberOfPaymentPeriods : int, present Value: decimal) Sales Quote -vehicle Sale Price: decimal -tradelnAmount: decimal -sales Tax Rate : decimal -accessoriesChosen : Accessories -exteriorFinishChosen : ExteriorFinish > +VehicleSale Price : decimal > +TradeInAmount: decimal > +AccessoriesChosen : Accessories > +Exterior FinishChosen : ExteriorFinish > > +Accessory Cost: decimal > > +FinishCost: decimal > > +SubTotal: decimal > > +SalesTax : decimal > > +Total : decimal > > +AmountDue : decimal +Sales Quote(vehicleSale Price : decimal, tradelnAmount : decimal, sales TaxRate : decimal, accessoriesChosen : Accessories, exterior FinishChosen : ExteriorFinish) +Sales Quote(vehicleSale Price : decimal, tradelnAmount : decimal, sales TaxRate : decimal) > > V > ExteriorFinish > Accessories Invoice -provincialSalesTax Rate : decimal -goodsAndServices Tax Rate : decimal > + ProvincialSales Tax Rate : decimal > +GoodsAndServices Tax Rate : decimal |> > +ProvincialSalesTaxCharged: decimal > > +GoodsAndServices TaxCharged: decimal > > +SubTotal : decimal > > +Total : decimal +Invoice(provincial Sales TaxRate : decimal, goodsAndServicesTax Rate : decimal) The ProvincialSalesTaxChanged, GoodsAndServices Tax Charged, and SubTotal properties are all abstract. This diagramming tool can not represent properties as abstract. > Cost Type Labour Part Material Servicelnvoice > > +LabourCost : decimal > > +Parts Cost : decimal > > +MaterialCost : decimal > > +ProvincialSalesTaxCharged: decimal > > +GoodsAndServicesTaxCharged: decimal > > +SubTotal : decimal > > +Total : decimal +Servicelnvoice(provincialTax Rate : decimal, goodsAndServices Tax Rate : decimal) +AddCost(type: Cost Type, amount : decimal) CarWashinvoice -packageCost : decimal -fragranceCost : decimal > +PackageCost : decimal > +FragranceCost : decimal > > +ProvincialSalesTaxCharged: decimal > > +GoodsAndServicesTaxCharged: decimal > > +SubTotal : decimal > > +Total : decimal +CarWashInvoice(provincialSales TaxRate : decimal, goodsAndServices TaxRate : decimal) +CarWashInvoice provincialSales TaxRate: decimal, goodsAndService TaxRate : decimal, packageCost: decimal, fragranceCost : decimal) > > Financial +GetPayment(rate : decimal, numberOfPaymentPeriods : int, present Value: decimal)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

How is slaked lime powder prepared ?

Answered: 1 week ago

Question

Why does electric current flow through acid?

Answered: 1 week ago

Question

What is Taxonomy ?

Answered: 1 week ago

Question

1. In taxonomy which are the factors to be studied ?

Answered: 1 week ago

Question

What are the purposes of collection messages? (Objective 5)

Answered: 1 week ago