Graderpractice for programmers

Back to 254275 OOP Lab 5-10

Q3. Add getContainerDescription() method

Problem

Reuse your Starbucks class from question 2. Add a method named getContainerDescription that returns "Normal glass", "Starbucks glass" as a String for the container name.

  private static Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {
        StarbucksShop d = input();

        System.out.println(d.getContainerDescription());
    }

    private static StarbucksShop input()
    {
        String menu = sc.nextLine();
        String size = sc.nextLine();
        char container = sc.nextLine().charAt(0);
        return new StarbucksShop(menu, size, container);
    }

Examples

Input

Smoked Butterscotch Frappuccino
tall
n

Output

Normal glass

Input

Manuka Honey Ginger Black Tea
venti
s

Output

Starbucks glass

Submit your solution

java