Question: Assignment: You are developing an e - commerce platform where promotions play a crucial role in attracting customers. A function called double calculateDiscountedPrice ( double

Assignment: You are developing an e-commerce platform where promotions play a crucial role in attracting customers. A function called double calculateDiscountedPrice(double originalPrice, double discountRate) has been implemented, but before deploying this feature, you need to ensure its accuracy by writing a driver program.
Fill in the main function in the assignment below to test for the following cases:
Test Case 1: Check if a 50% discount is correctly applied to a product priced at
50 product price unchanged.
Test Case 3: Ensure that a 100% discount on a
75 price.
Your output should be as follows:
Test Case 1: Price after a 50% discount on $100 is $50
Test Case 2: Price after a 0% discount on $50 is $50
Test Case 3: Price after a 100% discount on $100 is $0
Test Case 4: Price after a 25% discount on $75 is $56.25

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!