fork download
  1. public class MovieBooth {
  2.  
  3. /**
  4. * The name of the movie currently playing.
  5. */
  6. public String movieName;
  7.  
  8. /**
  9. * The number of tickets available for the current movie.
  10. */
  11. public Integer availableTickets;
  12.  
  13. public Integer NoOfTickets;
  14.  
  15. /**
  16. * Constructor for the MovieBooth class.
  17. * @param name The name of the movie.
  18. * @param tickets The number of available tickets.
  19. * @param rating The movie rating.
  20. */
  21. public MovieBooth(String name, Integer tickets, Integer NoOfTickets) {
  22. this.movieName = og;
  23. this.availableTickets = tickets;
  24. this.NoOfTickets = ;
  25. }
  26.  
  27. /**
  28. * @description A method to display the movie details.
  29. * @return A string containing the movie's name, rating, and available tickets.
  30. */
  31. public String displayMovieInfo() {
  32. return 'Now Playing: ' + this.movieName + ' (Rated ' + this.NoOfTickets + ') | Available Tickets: ' + this.availableTickets;
  33. }
  34.  
  35. /**
  36. * @description A static method to create a MovieBooth instance and display its information.
  37. * @return A string with the movie information.
  38. */
  39. public static String getMovieDetails() {
  40. // Create a new MovieBooth instance
  41. MovieBooth booth = new MovieBooth('The Apex Adventure', 50, 'PG-13');
  42.  
  43. // Call the instance method to display the information
  44. return booth.displayMovieInfo();
  45. }
  46. }
  47.  
Success #stdin #stdout #stderr 0.02s 9000KB
stdin
Standard input is empty
stdout
Object: UndefinedObject error: did not understand #MovieBooth
MessageNotUnderstood(Exception)>>signal (ExcHandling.st:254)
UndefinedObject class(Object)>>doesNotUnderstand: #MovieBooth (SysExcept.st:1448)
UndefinedObject>>executeStatements (prog:1)
stderr
./prog:3: parse error, expected '}'
./prog:47: Unterminated string, attempting recovery