Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases Organizing Information Digital And Information Literacy

Authors: Greg Roza

1st Edition

1448805929, 978-1448805921

Students also viewed these Databases questions

Question

1 What demand is and what affects it.

Answered: 1 week ago