Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
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...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started