Here is the finished code for the 3rd assignment for the CSC0005 course.
The main script starts the simulation and initializes all necessary classes, including Videos, Customer and Store.
There are a total of 4 classes which can be found in this folder
- Logs - A class responsible for logging data in the rental store
- Customer - The class for the Customers
- Store - The class for the video rental store
- Video - The class for the videos
Both Customer
and Video
uses a class factory method to create classes for each one of their types / categories. Both have similar designs where they both consists of a base class and a class factory.
We also have 2 utility scripts which provides us with the Random()
and randomUUID
function. (UUID is a buildint function from node:crypto
)
The UML class diagram can be found here
All configurations can be edited within the config script
- Node.js (LTS version is recommended)
-
Use
command prompt
orpowershell
on Windows |Termianl
Linux -
Clone this github repository
git clone https://github.com/Maxxxxxx-x/OO_HW3
- Change directory into the cloned folder
cd OO_HW3
- Check if node is installed on your machine
node -v
if there is no output with the NodeJS version, please install it / add it to the PATH
- Install the necessary dependencies with
npm i
- Run the script with command
npm run start