Write a C++ program that includes a function to calculate the discount applicable on the price of an item. Your function should have three arguments: the price as a reference parameter to a double, the discount as a double value, and a bool to indicate if the discount is calculated as a percentage or a fixed amount. Call the parameter to indicate whether the discount is a fixed amount, or a percentage, fixed. When fixed is true, it will indicate that the discount is a fixed amount and when it is false, the discount is a percentage. Your function should calculate the discount and modify the price of the item accordingly.
Your function should check that the discount is not negative and that the price does not drop to zero or below zero after applying the discount. Use the assert() function to ensure that the discount is not negative and that the price does not drop to zero or below zero once the discount is applied.
Test you program with the following input :
Shouldn't discount and discount type be obtained in main() and used in calcDiscount()
Also calcDiscount() should calculate the discount and apply it to the price. There is no indication in the requirements for this function to return a value.