Advertisement
CaptainManiac999

Advanced class with errors

Oct 27th, 2021
934
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  class AdvancedMovie
  2.          {
  3.              //these fields are not needed, it was me showing predefined values before making a constructor so they are not undefined
  4.              Title = "";
  5.              Year = 0;
  6.              Country = "";
  7.              Genre = "";
  8.              Director = "";
  9.              Rating = 0.0;
  10.              Artists = [];
  11.              constructor(_Title = "Ghosts of Mars",_Year = 2001,_Country = "USA",_Genre = "Action/Sci-Fi/Horror",_Director = "John Carpenter",_Rating = 4.9 ,_Artists = ["Natasha Henstridge","Ice Cube","Jason Statham","Clea DuVall","Pam Grier","Joanna Cassidy","Richard Cetrone","Rosemary Forsyth","Liam Waite","Duane Davis","Lobo Sebastian","Rodney A. Grant","Peter Jason","Wanda De Jesus","Doug McGrath","Rick Edelstein","Robert Carradine","Michael Krawic","Ellen Weisinger","Rex Linn","Matt Nolan","Marjean Holden","Charlotte Cornwell"])
  12.              {
  13.                  this.Title = _Title;
  14.                  this.Year = _Year;
  15.                  this.Country = _Country;
  16.                  this.Genre = _Genre;
  17.                  this.Director = _Director;
  18.                  this.Rating = _Rating;
  19.                  this.Artists = _Artists;
  20.              }
  21.  
  22.              get getTitle()
  23.              {
  24.                  return this.Title;
  25.              }
  26.  
  27.              get getYear()
  28.              {
  29.                  return this.Year;
  30.              }
  31.  
  32.              get getCountry()
  33.              {
  34.                  return this.Country;
  35.              }
  36.  
  37.              get getGenre()
  38.              {
  39.                  return this.Genre;
  40.              }
  41.  
  42.              get getDirector()
  43.              {
  44.                  return this.Director;
  45.              }
  46.  
  47.              get getRating()
  48.              {
  49.                  return this.Rating;
  50.              }
  51.  
  52.              get getArtists()
  53.              {
  54.                  return this.Artists;
  55.              }
  56.  
  57.              get getFullInfo()
  58.              {
  59.                  var FullInfo = "Movie Information: <br> Title: " + this.getTitle() + "<br>" + "Year: " + this.getYear() + "<br>" + "Country: " + this.getCountry() + "<br>" + "Genre: " + this.getGenre() + "<br>" + "Director: " + this.getDirector() + "<br>" + "Rating: " + this.getRating() + "<br>" + "Artists: " + this.getArtists() + "<br>";
  60.                  return FullInfo;
  61.              }
  62.  
  63.              set setTitle(_Title)
  64.              {
  65.                  this.Title = _Title;
  66.              }
  67.  
  68.              set setYear(_Year)
  69.              {
  70.                  this.Year = _Year;
  71.              }
  72.  
  73.              set setCountry(_Country)
  74.              {
  75.                  this.Country = _Country;
  76.              }
  77.  
  78.              set setGenre(_Genre)
  79.              {
  80.                  this.Genre = _Genre;
  81.              }
  82.  
  83.              set setDirector(_Director)
  84.              {
  85.                  this.Director = _Director;
  86.              }
  87.  
  88.              set setRating(_Rating)
  89.              {
  90.                  this.Rating = _Rating;
  91.              }
  92.  
  93.              set setArtists(_Artists)
  94.              {
  95.                  this.Artists = _Artists;
  96.              }
  97.          }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement