Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

ESC230 Lab 1: Using abstract data types and object persistence We have seen that it is possible template a class using interface classes, generics


student submitted image, transcription available below

student submitted image, transcription available below

student submitted image, transcription available below

student submitted image, transcription available below

student submitted image, transcription available below  
 
 
 

ESC230 Lab 1: Using abstract data types and object persistence We have seen that it is possible template a class using interface classes, generics and to create a persistent object or objects in Java by saving the object information to disc. In this Jab, you need to define the interface(s) for creating the necessary objects for a Media Library and to write a program to allow the user to enter in the information and to utilize a persistent data structure to store items in a media library. You can get the beginning project files by copying your files by downloading the project template. You will be writing code in a new Java file in this project. Here are some other requirements: 1. You should not use any System.out.println or any Scanner methods. 2. You will need to define the interfaces identified in the skeleton code to be used with the generic class Library And then create your classes and hierarchy based on those interfaces. 3. Store the library on disk and then retrieve the library from disk and retrieve a specific media object to display. Submit your lab by zipping up your Java project files and you lab report and uploading the zip file to Moodle. Submit the answers to these questions: 1. This lab utilizes a class hierarchy that models media in a library. Create a framework.diancam for thichiararrhi Submit your lab by zipping up your Java project files and you lab report and uploading the zip file to Moodle. Submit the answers to these questions: 1. This lab utilizes a class hierarchy that models media in a library. Create a framework diagram for this hierarchy. 2. Is this a good use of an interface? Why or why not? Give specific reasons 3. Does the use of a generic provide you with the required flexibility you need in a program like this? Why or why not? Give specific reasons. C: > Users > User 1 > AppData > Local > Temp > Tempfa7c0712-faf6-4c30-a package CSC110; class Library { private List resources new ArrayList (); 1 2 3 import java.util.List; 4 import java.util.ArrayList; S 6 7 8 9 10 11 } 12 13 14 int size resources.size(); 15 16 public void addMedia(Tx) { resources.add(x); public T retrieveLast() if (size > 0) { return (T) resources.get(size 1); return null; - interface Media { // Sample interface definition// abstract String checkOutStatus(); abstract void checkOutTo(String userName, String outDate, String dueDate); abstract void checkIn(); 17 18 19 20 } 21 22 23 24 25 26 27 28 @ 29 interface Book extends Media { 30 } 31 32 33 } 34 In 15, Col 2 Spaces: 4 UTF-8 CRLF 21 22 23 24 25 26 27 28 29 interface Media { // Sample interface definition// abstract String checkOutStatus(); abstract void checkOutTo(String userName, String outDate, String dueDate); abstract void checkIn(); 30 } interface Book extends Media { 31 32 33 } 34 35 36 37 38 39 interface Video extends Media { } interface Newspaper extends Media { } > Users > User 1 > AppData > Local > Temp > Temp4e87e132-1954-4bcb-b285-a1925fd85224 LibraryLabOne.zip > LibraryLabOne > src > CSC230> Lab > J Main.java package CSC110; 1 2 3 public class Main ( 4 5 public static void main(String[] args) ( 6 // write your code here. 8 9 } I

Step by Step Solution

There are 3 Steps involved in it

Step: 1

Id be glad to provide the complete code with explanations incorporating the insights from the ratings Complete Code Java package CSC110 import javautilArrayListimport javautilList public class Library ... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Statistics Unlocking The Power Of Data

Authors: Robin H. Lock, Patti Frazer Lock, Kari Lock Morgan, Eric F. Lock, Dennis F. Lock

1st Edition

0470601876, 978-0470601877

More Books

Students also viewed these Programming questions