Question: Invoice Class Namespace: Last.First.Business This abstract class contains functionality that supports the business process of creating an invoice. Create the Invoice class in the Library

Invoice Class

Namespace: Last.First.Business

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 Last.First.Business namespace.

Design

Invoice 
- provincialSalesTaxRate : decimal - goodsAndServicesTaxRate : decimal <> + ProvincialSalesTaxRate : decimal <> + GoodsAndServicesTaxRate : decimal <> <> + ProvincialSalesTaxCharged : decimal <> <> + GoodsAndServicesTaxCharged : decimal <> <> + SubTotal : decimal <> <> + Total : decimal 
+ Invoice(provincialSalesTaxRate : decimal, goodsAndServicesTaxRate : decimal) 

The ProvincialSalesTaxCharged, GoodsAndServicesTaxCharged, and SubTotal properties are to be declared as abstract.

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 - Thrown when the property is set to less than 0. Message: The value cannot be less than 0. Parameter name: value.
  • ArgumentOutOfRangeException - Thrown 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 - Thrown when the property is set to less than 0. Message: The value cannot be less than 0. Parameter name: value.
  • ArgumentOutOfRangeException - Thrown 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 (Rounded to two decimal places).

+ GoodsAndServicesTaxCharged : decimal (Abstract) - Gets the amount of goods and services tax charged to the customer (Rounded to two decimal places).

+ SubTotal : decimal (Abstract) - Gets the subtotal of the Invoice.

+ Total : decimal - Gets the total of the Invoice. The total is the sum of the subtotal and 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 - Thrown when the provincial sales tax rate is less than 0. Message: The argument cannot be less than 0. Parameter name: provincialSalesTaxRate.
  • ArgumentOutOfRangeException - Thrown when the provincial sales tax rate is greater than 1. Message: The argument cannot be greater than 1. Parameter name: provincialSalesTaxRate.
  • ArgumentOutOfRangeException - Thrown when the goods and services tax rate is less than 0. Message: The argument cannot be less than 0. Parameter name: goodsAndServicesTaxRate.
  • ArgumentOutOfRangeException - Thrown when the goods and services tax rate is greater than 1. Message: The argument cannot be greater than 1. Parameter name: goodsAndServicesTaxRate.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!