can anyone help me to write a code for this by java?
@AlexandervonHumboldt2
public class Movie { private String title; private List<String> starring; private String country; private String language; private double runningTime; //No‐argument constructor public Movie(){ String title = "Minions"; String starring = new ArrayList<>() {"Sandra Bullock", "Jon Hamm", "Michael Keaton", "Allison Janney", "Steve Coogan"}; String country = "United States"; String language = "English"; double runningTime = 91; //Time in min } //Argument constructor public Movie (String title,List<String> starring,String country,String language,double runningTime){ this.title=title; this.starring=starring; this.country=country; this.language=language; this.runningTime=runningTime; } public String toString(){ String starring=""; for(String name= this.starring){ starring+=name; } return title + "\n" + starring + "\n" + country + "\n" + language + "\n" + runningTime; } ---------------- public class Library { Movie[] libraryMovies =new Movie[5]; public void addMovie(Movie movies ){ } public void borrowMovie(String movieTitle){ for(Movie item: libraryMovies){ if(movieTitle.equals(item.title)) borrowMovie = true; else System.out.println("Sorry, the movie is not available"); } if(borrowMovie &&! returnMovie) System.out.println("Sorry, you can’t borrow a movie twice unless it has been returned"); } public void returnMovie(String movieTitle){ returnMovie = true; System.out.println("You successfully returned " + movieTitle); } public void printAvailableMovies(){ for(int x=0; x<libraryMovies.length ; x++){ System.out.println(libraryMovies[x].getTitle); } } }
I try to solve it but there is many error and task3 i can not solve it .. can any one help me to continue ?
@ParthKohli @UnkleRhaukus @TheSmartOne @robtobey @mathmate @bibby @Jaynator495 @Elsa213
@Jaynator495
@e.mccormick
Join our real-time social learning platform and learn together with your friends!