You will need to design an application that will receive the customer type and its units of utility used for the billing duration. The application will calculate and display the cost per unit based on the customer type and the total charges for that billing cycle. Calculate the charges using the following data. Customer Type Units Consumed Cost per unit ($) Commercial <= 1,000 $0.50 per unit Commercial 1,000 < $0.50 per unit Industrial < 800 $0.65 per unit Industrial 800 <= 2,000 $0.55 per unit Industrial 2,000 < $0.50 per unit Residential < 500 $0.85 per unit Residential 500 <= $0.75 per unit Make sure that the units consumed entered is a positive number and the Customer Type is valid; otherwise your program should display an error message and ask for the data to be entered again until the user enters valid data. Test your algorithm with the following three sets of data. Test case 1: Units used of 799, Customer Type is Industrial Test case 2: Units used 500, Customer Type is Residential Test case 3: Units used 800, Customer Type is Industrial Test case 4: Units used 1000, Customer Type is Commercial Test case 5: Units used 499, Customer Type is Residential Rubric

Designing an application that calculates and displays the cost per unit and total charges for a given customer type and units consumed during a billing cycle requires careful consideration of the billing rates for each customer type and input validation to ensure the entered data is valid. In this assignment, we will develop an algorithm to implement this application and test it with five different sets of data.

To begin, let’s define the customer types and their corresponding billing rates. According to the given data, we have three customer types: Commercial, Industrial, and Residential. The billing rates for each customer type based on units consumed are as follows:

– For Commercial customers: If the units consumed are less than or equal to 1,000, the cost per unit is $0.50. If the units consumed are more than 1,000, the cost per unit is less than $0.50.

– For Industrial customers: If the units consumed are less than 800, the cost per unit is $0.65. If the units consumed are between 800 and 2,000 (inclusive), the cost per unit is $0.55. If the units consumed are more than 2,000, the cost per unit is less than $0.50.

– For Residential customers: If the units consumed are less than 500, the cost per unit is $0.85. If the units consumed are 500 or more, the cost per unit is less than $0.75.

Now that we have defined the customer types and their billing rates, we can proceed to design the algorithm for our application. We will start by taking user input for the customer type and units consumed. Then, we will validate the input to ensure that the units consumed is a positive number and the customer type is valid. If the input is invalid, we will display an error message and ask for the data to be entered again until the user provides valid data.

Once the input is validated, we will apply the corresponding billing rate for the given customer type and units consumed to calculate the cost per unit. We will then multiply the cost per unit by the units consumed to obtain the total charges for the billing cycle. Finally, we will display the cost per unit and total charges to the user.

The algorithm will be tested with the following five sets of data:
1. Test case 1: Units used of 799, Customer Type is Industrial
2. Test case 2: Units used of 500, Customer Type is Residential
3. Test case 3: Units used of 800, Customer Type is Industrial
4. Test case 4: Units used of 1000, Customer Type is Commercial
5. Test case 5: Units used of 499, Customer Type is Residential

By applying the algorithm to each test case, we can verify that the application correctly calculates the cost per unit and total charges for different customer types and units consumed.

Need your ASSIGNMENT done? Use our paper writing service to score better and meet your deadline.


Click Here to Make an Order Click Here to Hire a Writer