Skip to content

This respository is for Day 6 task, which includes class, object, getter & setters and all about OOP

Notifications You must be signed in to change notification settings

santhosh404/OOPS-in-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Task 1: The class Movie is stated below. An instance of class Movierepresents a film. This class has the following three properties:

  • title, which is a String representing the title of the movie
  • studio, which is a String representing the studio that made the movie
  • rating, which is a String representing the rating of the movie (i.e. PG­13, R, etc)

  1. Write a constructor for the class Movie, which takes a String representing the title of the movie, a String representing the studio, and a String representing the rating as its arguments, and sets the respective class properties to these values.
  2. The constructor for the class Movie will set the class property rating to "PG" as default when no rating is provided.
  3. Write a method getPG, which takes an array of base type Movie as its argument, and returns a new array of only those movies in the input array with a rating of "PG". You may assume the input array is full of Movie instances. The returned array need not be full.
  4. Write a piece of code that creates an instance of the class Movie with the title “Casino Royale”, the studio “Eon Productions”, and the rating “PG­13”

Task 2: Circle - Class: Convert the UML diagram to Typescript class. - use number for double

Task 3: Write a “person” class to hold all the details

Task 4: Write a class to calculate the Uber price.

Note: Created simple Ui and also used concepts like OOP, getter-setter, etc. And attached the UI and Console snapshot below


alt text

alt text

About

This respository is for Day 6 task, which includes class, object, getter & setters and all about OOP

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published