Question: Write a Java program: Subscription Cost calculator. READ BEFORE ANSWERING: The Code should be complete without any errors and should execute. Incomple code or code

Write a Java program: Subscription Cost calculator.

READ BEFORE ANSWERING:

The Code should be complete without any errors and should execute.

Incomple code or code with erros and logical problem will get a downvote.

Consider the following:

1] Use the Design principles and design patterns in the code

2] Write Executable code with Junit Tests and Console Tests.

Given the pricing plan (monthly) for products and customers would subscribe to the list of products.

JSON Structure :

[{

"planId": "BASIC",

"monthlyCost": "9.99"

}, {

"planId": "STANDARD",

"monthlyCost": "49.99"

}, {

"planId": "PREMIUM",

"monthlyCost": "249.99"

}]

// Customer subscription information

{

"customerId": "c1",

"product": {

"name": "Jira",

"subscription" : {

"planId": "BASIC",

"startDate": "2021-01-01" // YYYY-MM-DD format

}

}

}

Create model classes and service class (s) (CostExplorer) to expose the below two APIs:

monthlyCostList(): Array/List of size 12 filled with the cost incurred in each month of the unit year

annualCost(): Total cost in a unit year

Consider the annual package from JAN - DEC.

For simplicity, let's assume we will charge the customer for the entire month even if the customer is subscribing any day after the 1st of the month.

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!