Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Assume that the following interface has been created. Do not write any import st

ID: 3587421 • Letter: A

Question

Assume that the following interface has been created. Do not write any import statements. An interface named AttentionSeeking This interface has a single public method called getAttention that takes a single int parameter and returns a String What you need to do: 1.) Write a class called Cat with a default no argument constructor that implements the interface. 2.) You do not need to create any attributes for this class. 3.) You will need to make the class implement the interface and write a public implementation for the method defined in the (Do not use the public keyword when defining this class.) interface 4.) The implementation of the public method should create a String that indicates how the pet gets attention. For the Cat class that message is: Wrow!!! 5.) The int parameter passed into the method should be used to create the message the number of times indicated by the parameter and should include a new line character after each message. For example: If the method is called on a Cat object and the message is Wrow!!! If the method is passed a value of 4 then the method should return. Wrow!!! Wrow!!! Wrow!!! Wrow!!! SUBMIT 1 of 1: Fri Oct 06 2017 15:43:37 GMT+ 1100 (AEDT) 1 Type your solution here...

Explanation / Answer

import java.io.*;

interface AttentionSeeking {

public void getAttention(int a);
  
}

class Cat implements AttentionSeeking {

   public void getAttention(int a){
       for (int i = 0; i<a; i++){
          String msg = "Wrow!!!";
          System.out.print(msg);
          System.out.println();
       }
   }
}

public class DemoCat{
   public static void main(String[] args){
     AttentionSeeking a = new Cat();
     a.getAttention(4);
   }
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote