Question: Evaluate the following code Interfaces.java Create a java program using interfaces to display your textbook information: 1.- Textbook: Title, Author, year of publication, and edition

Evaluate the following codeInterfaces.java

Create a java program using interfaces to display your textbook information:

1.- Textbook: Title, Author, year of publication, and edition

Important: extra credit will be given (up to 15 points) if you enhance your program to request such info from the user.

Ignore the book as I will add it. I am looking to create this for a library as a powerful search tool but still showcase interfaces and user input (that displays the Title, Author, Year of publication, and Edition).

 //Chapter 9: Java Interfaces //Code is based on: https://www.w3schools.com/java/java_interface.asp interface Animal { public void animalSound(); // interface method (does not have a body) public void sleep(); // interface method (does not have a body) } class Cow implements Animal { public void animalSound() { System.out.println("The cow says: moo"); } public void sleep() { System.out.println("The cow sleeps from 7 to 12 hours "); } } class Interfaces { public static void main(String[] args) { Cow myCow = new Cow(); myCow.animalSound(); myCow.sleep(); } }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Textbook Interface and User Input Program Heres a Java program using interfaces to represent a textbook and capture user input for extra credit 15 poi... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!