https://github.com/mohamedumar083/day-6
Day-6 Tasks
https://github.com/mohamedumar083/day-6
class get-method method set-method
Last synced: 3 months ago
JSON representation
Day-6 Tasks
- Host: GitHub
- URL: https://github.com/mohamedumar083/day-6
- Owner: MohamedUmar083
- Created: 2024-03-28T07:00:13.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2024-04-01T19:47:45.000Z (about 1 year ago)
- Last Synced: 2025-01-10T09:12:31.729Z (5 months ago)
- Topics: class, get-method, method, set-method
- Language: JavaScript
- Homepage:
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
This Repo contains Day-6 problems solved by using "CLASS,SET,GET METHODS" for the above Questions :
1) The class Movie is stated below. An instance of class Movie represents 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. PG13, 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 “PG13”
2) Circle(radius,color) , set Color,get Color , set Radius ,get Radius, get toString, get Area,get Circuferance.
3) Write a “person” class to hold all the details.
4) write a class to calculate the Uber price.