Question
Part 1 Solution: [ https://www.chegg.com/homework-help/questions-and-answers/creating-projects-solutions-visual-studio-design-modify-add-subtract-members-classes-const-q66210449?trackid=tL31TJtu ] Part 2 : https://www.chegg.com/homework-help/questions-and-answers/zoom-pic-visual-studio-part-1-solution-https-wwwcheggcom-homework-help-questions-answers-c-q66611338 Part 2.1 ServiceInvoice Class This class contains functionality that supports the business process of creating
Part 1 Solution: [ https://www.chegg.com/homework-help/questions-and-answers/creating-projects-solutions-visual-studio-design-modify-add-subtract-members-classes-const-q66210449?trackid=tL31TJtu ] Part 2 : https://www.chegg.com/homework-help/questions-and-answers/zoom-pic-visual-studio-part-1-solution-https-wwwcheggcom-homework-help-questions-answers-c-q66611338
Part 2.1 ServiceInvoice Class
This class contains functionality that supports the business process of creating an invoice for the service department. The ServiceInvoice class derives from the Invoice class.
Create the ServiceInvoice class in the Library project. This class must be defined under the My.Business namespace.
Properties
LabourCost : decimal
Gets the amount charged for labour.
PartsCost : decimal
Gets the amount charged for parts.
MaterialCost : decimal
Gets the amount charged for shop materials.
ProvincialSalesTaxCharged : decimal
Gets the amount of provincial sales tax charged to the customer. Provincial Sales Tax is not applied to labour cost.
GoodsAndServicesTaxCharged : decimal
Gets the amount of goods and services tax charged to the customer.
SubTotal : decimal
Gets the subtotal of the Invoice.
Total : decimal
Gets the total of the Invoice. (** The LabourCost, PartsCost and MaterialCost properties have a private set accessor. *)
Methods
ServiceInvoice(decimal, decimal)
Initializes an instance of ServiceInvoice 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".
AddCost(CostType, decimal) : void
Increments a specified cost by the specified amount.
Parameters:
- type - The type of cost being incremented.
- amount - The amount the cost is being incremented by.
Exceptions:
- System.ComponentModel.InvalidEnumArgumentException - When the cost type is an invalid argument. Message: "The argument is an invalid enumeration value".
- ArgumentOutOfRangeException - When the amount is less than or equal to 0. Message: The argument cannot be less than or equal to 0. Parameter name: "amount".
CarWashInvoice Class - This class contains functionality that supports the business process of creating an invoice for the car wash department. The CarWashInvoice class derives from the Invoice class. Create the CarWashInvoice class in the Library project. This class must be defined under the My.Business namespace.
Fields
packageCost : decimal - The amount charged for the chosen package.
fragranceCost : decimal - The amount charged for the chosen fragrance.
Properties
PackageCost : decimal
Gets and sets the amount charged for the chosen package.
Exception:
- ArgumentOutOfRangeException - When the property is set to less than 0. Message: The value cannot be less than 0. Parameter name: "value".
FragranceCost : decimal
Gets and sets the amount charged for the chosen fragrance.
Exception:
- ArgumentOutOfRangeException - When the property is set to less than 0. Message: The value cannot be less than 0. Parameter name: "value".
ProvincialSalesTaxCharged : decimal
Gets the amount of provincial sales tax charged to the customer. No provincial sales tax is charged for a car wash.
GoodsAndServicesTaxCharged : decimal
Gets the amount of goods and services tax charged to the customer.
SubTotal : decimal
Gets the subtotal of the Invoice.
Total : decimal
Gets the total of the Invoice.
Methods
CarWashInvoice(decimal, decimal)
Initializes an instance of CarWashInvoice with a provincial and goods and services tax rates. The package cost and fragrance cost are zero.
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".
CarWashInvoice(decimal, decimal, decimal, decimal)
Initializes an instance of CarWashInvoice with a provincial and goods, services tax rate, package cost and fragrance cost.
Parameters:
- provincialSalesTaxRate - The rate of provincial tax charged to a customer.
- goodsAndServicesTaxRate - The rate of goods and services tax charged to a customer.
- packageCost - The cost of the chosen package.
- fragranceCost - The cost of the chosen fragrance.
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".
- ArgumentOutOfRangeException - When the package cost is less than 0. Message: The argument cannot be less than 0. Parameter name: "packageCost".
- ArgumentOutOfRangeException - When the fragrance cost is less than 0. Message: The argument cannot be less than 0." Parameter name: "fragranceCost".
CostType Enumeration Namespace: My.Business
The CostType enumeration has the following values:
- Labour
- Part
- Material
Financial Class
This static class contains functionality that includes financial functions.
Create the Financial class in the library project. This class must be defined under the My.Business namespace.
Methods
GetPayment(decimal, int, decimal) : decimal
Returns the payment amount for an annuity based on periodic, fixed payments and a fixed interest rate.
Parameters:
- rate - the interest rate per period. For example, if the rate is an annual percentage rate (APR) of 10 percent and the customer makes monthly payments, the rate per period is 0.1/12, or 0.0083.
- numberOfPaymentPeriods - the total number of payment periods in the annuity. For example, if you make monthly payments on a four-year car loan, your loan has a total of 4 12 (or 48) payment periods.
- presentValue - the present value (or lump sum) that a series of payments to be paid in the future is worth now. For example, when a customer finances a car, the loan amount is the present value to the lender of the car payments the customer will make.
Exceptions:
- ArgumentOutOfRangeException - When the rate is less than 0. Message: The argument cannot be less than 0. Parameter name: "rate".
- ArgumentOutOfRangeException - When the rate is greater than 1. Message: The argument cannot be greater than 1. Parameter name: "rate".
- ArgumentOutOfRangeException - When the number of payments is less than or equal to zero. Message: The argument cannot be less than or equal to 0. Parameter name: "numberOfPaymentPeriods".
- ArgumentOutOfRangeException - When the present value is less than or equal to zero. Message: The argument cannot be less than or equal to 0. Parameter name: "presentValue".
CODE to CALCULATE the Payment:
decimal futureValue = 0; decimal type = 0; decimal payment = 0;
if (rate == 0) payment = presentValue / numberOfPaymentPeriods;
else payment = rate * (futureValue + presentValue * (decimal)Math.Pow((double)(1 + rate), (double)numberOfPaymentPeriods)) / (((decimal)Math.Pow((double)(1 + rate), (double)numberOfPaymentPeriods) - 1) * (1 + rate * type));
return Math.Round(payment, 2);
*******************
See this link please for Part 1 and Part 2
Part 1 Solution: [ https://www.chegg.com/homework-help/questions-and-answers/creating-projects-solutions-visual-studio-design-modify-add-subtract-members-classes-const-q66210449?trackid=tL31TJtu ]
Part 2 : https://www.chegg.com/homework-help/questions-and-answers/zoom-pic-visual-studio-part-1-solution-https-wwwcheggcom-homework-help-questions-answers-c-q66611338
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