Graderpractice for programmers

Back to 254275 OOP - Labs 6-10 Review

5. Count the songs in a movie

Problem

Add a method called getMovie() to the Soundtrack class.

Test code:

class Task5 {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String movie = sc.nextLine();
        int songs = Integer.parseInt(sc.nextLine());

        Soundtrack st1 = new Soundtrack(movie + " Soundtrack", "Various Artists", songs, movie);
        System.out.print("There are " + st1.getSongs());
        System.out.println(" songs in the movie " + st1.getMovie());
    }
}

Examples

Input

La La Land
15

Output

There are 15 songs in the movie La La Land

Submit your solution

java