Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/dev-sathya17/-day6-guvi


https://github.com/dev-sathya17/-day6-guvi

Last synced: about 2 months ago
JSON representation

Awesome Lists containing this project

README

        

# Day6-GUVI

### Task 1:

> **Class-Movie**
> [Source Code Directory](./Task-Movie/script.js)
> Explanation:
>
> - The file contains a class named as **Movie** which contains the properties of the movie such as title, studio and rating.
> - Rating is set to default value as _PG_.
> - A parameterized constructor function is defined to initialize the movie properties.
> - A static function _getPG()_ is defined to return the _Movie instances_ that have a rating of _PG_ only.
> - In further lines of code, the instances are created and the static function is used to obtain _Movie instances_ that have a rating of _PG_ only.
> - The Output can be viewed in the IDE Output console.

---

### Task 2:

> **Class-Circle**
> [Source Code Directory](./Task-Circle/script.js)
> Explanation:
>
> - The file contains a class named as **Circle** which contains the properties of a circle such as radius and color.
> - Both values are initially default to **1.0** and **red** respectively.
> - The class contains **getters** and **setters** for color and radius properties to retrieve and also alter the values of the _Circle instance_.
> - Custom methods _getArea()_ and _getCircumference()_ are written to calculate and obtain the area and circumference of the circle.
> - A custom representation of the _toString()_ method is created in the given format.
> - In further lines of code, instance for the _Circle_ class is created and initialized.
> - All getters and setters and the custom class methods _getArea()_ and _getCircumference()_ are demonstrated
> - The Output can be viewed in the IDE Output console.

---

### Task 3

> **Class-Person**
> [Source Code Directory](./Task-Person/script.js)
> Explanation:
>
> - The file contains a class named as **Person** which contains the details of a person such as name, email, age and address.
> - getters and setters for all the properties are implemented in the class.
> - Custom representation for the object is defined by using _Person.prototype.toString()_ method
> - In further lines of code, all the method implementations are demonstrated.
> - The Output can be viewed in the IDE Output console.

---

### Task 4

> **Class-UberRide**
> [Source Code Directory](./Task-Uber/script.js)
> Explanation:
>
> - The file contains a class named as **UberRide** which contains the details of a person such as peakTime, baseFare, minuteRate and kilometerRate.
> - A custom method, _getPrice()_, is defined to calculate the fare of a ride.
> - The method takes a few arguments like rideDistance, rideDuration and isPeak.
> - Required logic for the method is implemented.
> - In further lines of code, fare calculation for a trip is demonstrated.
> - The Output can be viewed in the IDE Output console.