rentCalculator

Language - Javascript/Typescript DB - Mongodb/SQL (postgres)

Problem Statement It is a program to calculate and print a statement of a customer's charges at a book rental store. It is divided into 3 stories. Pick each story in sequence, solve it, test it, and then pick up next. Next story should be applied in same solution and your design should start evolving.

Story 1: Customers can rent the books from the store. The rent changes will be calculated on the basis of number of books rented and durations for each book it was rented. Per day rental charge is Rs 1.

Story 2: There are three kinds of books: regular, fiction, and novels. For Regular books renting per day charge is Rs. 1.5. For fiction book renting per day charge is Rs. 3. For novels the per day charge is Rs. 1.5.

Story 3: The store decided to alter the calculations for Regular books and novels. Now for Regular books for first 2 days charges will be Rs 1 per day and 1.5 Rs there after. Minimum changes will be considered as Rs 2 if days rented is less than 2 days. Similarly for Novel minimum charges are introduced as 4.5 Rs if days rented is less than 3 days.