Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please use the given code as well Draft version Back to Classroom Submit Before: 1/17/2022, 11:55:00 PM Language Ja Assignment 1 Imagine a pile of
Please use the given code as well
Draft version Back to Classroom Submit Before: 1/17/2022, 11:55:00 PM Language Ja Assignment 1 Imagine a pile of books on your desk. Each book is so large and heavy that you can remove only the top one from the pile. You cannot remove a book from under another one. Likewise, you cannot add a book beneath another one. You can add another book to the pile only by placing it on the top of the pile. What other operations you can perform with a pile of book? Looking for a specific book, count how many books are in the pile, and determine the title of a book at a specific position in the pile. These operations will need to be defined in the interface. Run Debug Stop Save A submit Main.java 1- interface IBookPile { 2 3 ** 4 * add book to the top of the pile 5 6 void add(String title); 7 } 8 9 public class Main 10- { 11 public static void main(String[] args) { 12 IBookPile pile = null; 13 14 pile.add("Java 1"); 15 pile.add("Data Structures"); 16 pile.add("JSP"); 17 18 } 19} 20 21 BABARA If you represent books by their titles alone, design a class that you can use to track the books in the pile on your desk. Write a Java interface called IBookPile for the pile's methods. Include javadoc- style comments in your code. Write a main class that demonstrate how you would use the interface. I provided a little bit of code to get you start. input Command line Standard Input: O Interactive Console O TextStep by Step Solution
There are 3 Steps involved in it
Step: 1
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