Question
Write a Java program: Subscription Cost calculator Consider the following: 1] Use Design principles and design patterns 2] Write Executable code with Junit Tests and
Write a Java program: Subscription Cost calculator
Consider the following:
1] Use Design principles and design patterns
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
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