Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

the below code must delete the resources added to the arraylist CMlist using the deletehumanresources() method. also load the resources from the file and add

the below code must delete the resources added to the arraylist "CMlist" using the deletehumanresources() method.

also load the resources from the file and add to the list cmlist using loadhumanresources too and also print..

image text in transcribed

image text in transcribed

image text in transcribedimage text in transcribed

import java.io.*; import java.util.*; public class CMS implements Serializable 1 String FILENAMEcms; private File file; private ArrayList CMlist = new ArrayList(); ArrayList printlist = new ArrayList(); ArrayList temp = new ArrayList(); Scanner innne - new Scanner(System.in); public CMS() { CMlist = new ArrayList(); FILENAMECM = "temfile.dat";// the name of the file for reservation file = new File(FILENAMEcms); } public CMS(String filename) { CMlist = new ArrayList(); FILENAMEms = filename; file = new File(FILENAMEcms); } public void addcmsResource(String tYPE) { // it adds to the list if (tYPE.toLowerCase().matches ("teacher"))// associate to the teacher class using the interfaces {// this method only adds the cms resources to the list and then asks in the main 1/ program to save the resources to file or not! cmsteacher teac = new cmsteacher(); CMlist.add(teac. Resourceutilizer(); } else if (tYPE.toLowerCase().matches ("student")) { Student student = new Student(); CMlist.add(student. ResourceUtilizer(); } } CMlist.add(student. ResourceUtilizer(); } } public void delcms Resource(String id) throws IOException, FileNotFoundException, NullPointerException { for (int i = 0; i

Step by Step Solution

There are 3 Steps involved in it

Step: 1

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

Modern Database Management

Authors: Jeffrey A. Hoffer Fred R. McFadden

9th Edition

B01JXPZ7AK, 9780805360479

More Books

Students also viewed these Databases questions

Question

Which are non projected Teaching aids in advance learning system?

Answered: 1 week ago