Graderpractice for programmers

Back to 254275 OOP - Labs 6-10 Review

3. Is it an EP?

Problem

An EP is a short album with less than 8 songs. Add a method named isEP that returns true if the album is an EP.

Test code:

class Task3 {

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

        Album album1 = new Album(title, artist, songs);
        if (album1.isEP()) {
            System.out.println(album1.getTitle() + " is short");
        } else {
            System.out.println(album1.getTitle() + " is normal");
        }
    }
}

Examples

Input

The Kids Are Coming
Tones And I
6

Output

The Kids Are Coming is short

Input

Sweetener
Ariana Grande
15

Output

Sweetener is normal

Submit your solution

java