Skip to content

Latest commit

 

History

History
37 lines (21 loc) · 1.67 KB

README.md

File metadata and controls

37 lines (21 loc) · 1.67 KB

Day 6 Task

Object Oriented Programming in JavaScript

  1. Created a class Movies with constructor and in this class we have given three properties: title, studio, and rating:
    1. The constructor of the class Movies set the class property rating to "PG" as the default when no rating is provided
    2. Created a new object with the object name and passed the properties values
    3. Displayed the PG rated movies by using getPG method
    4. Get the code in the OOP in JS folder
  2. Created a class Circle with constructor and this we have two properties radius and colora:
    1. Displayed the radius and colour by using a getter
    2. Displayed the updated radius and colour by using a setter
    3. Calculated the area and circumference of the circle by using both the initial values and the updated values.
    4. Get the code in the OOP in JS folder
  3. Created a Person class to hold all the details of the person:
    1. In constructor, this class has some random information(properties) about the person
    2. Displayed the information of the person from the class by using getter and updated it by using setter
    3. Get the code in the OOP in JS folder
  4. Displayed the price detail of an Uber ride by using class in JS:
    1. Created a class UberPriceCalculation with constructor(baseFare, costPerKm, costPerMinute)
    2. Set values for this class by creating a new object with uberPriceCalculatio as an object name
    3. Calculated and displayed the Uber ride price for the given values
    4. Get the code in the OOP in JS folder