Question: ( 2 2 marks ) In the Rooms class library project, create both a pure interface IClassroomManager and a class ClassroomManager that implements the interface.

(22 marks) In the Rooms class library project, create both a pure interface IClassroomManager and a
class ClassroomManager that implements the interface. The class (and therefore the interface) capture
the responsibilities of maintaining/recording/storing classroom records. The sub-points b to f below
define the methods that need to be in the pure interface, and therefore in the class as well to
implement that interface.
a. Consider the following as general guidelines for this class and the interface:
i. The constructor and all methods should pass on any exceptions to the calling code.
ii. It should have a private string data field that defines a hard-coded filename (e.g.
"classrooms.txt") used to store Classroom objects.
iii. The file format must be as follows:
One classroom record per line.
The properties of each classroom record should be delimited by the vertical
slash, or pipe, character - i.e. the "I" character.
iv. It should also have a default (i.e. no argument) constructor that, at the very least,
creates the file if it doesn't already exist.
v. As mentioned, the remaining sub-points (namely b to f) define the public interface for
the pure interface and therefore of the class as well. However, for the class you will also
likely need private helper methods that do the work of:
Parsing a file record (i.e. line of the file) into a Classroom object.
Writing a Classroom object to a file record string with properties delimited by a
"|".
Reading/Writing Classroom objects from/to the file.
b. A method GetNextClassroom/d that returns an int that is a new Id that doesn't conflict with
anything already stored on file and can therefore be used for a new Classroom.
c. An AddClassroom method with return type void that takes a Classroom object as an input
parameter that represents a classroom record to be stored and appends it to the end of the file.
d. A GetAllClassrooms method that returns a List
Can you help me. Needs to be done in C#
( 2 2 marks ) In the Rooms class library project,

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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!