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

What you need to do: 1.) Write a class called Cat with a default no arqument con

ID: 3587430 • Letter: W

Question

What you need to do: 1.) Write a class called Cat with a default no arqument constructor that implements the interface. (Do not use the public keyword when defining this class.) 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 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 | 4 of 4: 2017-10-06 01:12:40w 1 class Cat implements AttentionSeeking

Explanation / Answer

Here is the Code

AttentionSeeking.java
public interface AttentionSeeking {
public void getAttention(int a);
}

Save this file as DemoCat.java

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

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

Let me know in comments if this doesn't work for you with exact issue you are getting and I will try to fix it.

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