Homework #6 CMSC 131
Due Friday July 23rd, 2004 Object-Oriented Programming I
 Type of Homework: Closed Summer 2004

Objective

This homework will give you practice with one-dimensional arrays of references,  class design, and class implementation.

Overview

Management of computer accounts  is one of the the tasks computer system administrators are responsible for.  Typical activities include: account creation/removal, quota increase, and  information reports.  In this homework you will implement a simplified version of an account manager.  

For this homework, support classes will not be provided.  The only files available in the code distribution are a Driver.java file which just starts the system you will implement, and a timelog file.  You will design and implement all the classes of the system.

 This homework will be graded as follows:

Specifications

Terms

Before we continue, let's define some terms we will be using throughout the description.

      We will use megabytes (MB) as the disk space unit.

Tasks

You will write a program that enables a system administrator complete the following tasks:

For simplicity our system only have one computer.  When the program starts, it prompts the system administrator for the name of the computer and the maximum disk space.  Afterwards the program will process the aforementioned tasks until the "quit" option is chosen.  The "Sample Run" section provides a sample run of the program you are expected to write.

Your Assignment

You assignment consists in implementing three classes that will represent the accounts management system.  The classes are:

You can other fields (instance variables) if you understand they are necessary.

Methods to Implement

The description below provides an idea of some of the methods each of the classes must have.  By no means the list is complete.  It is your responsibility to define any necessary methods so that you can implement the account management system.

                   "Computer Name: "<computerName>

                   "DiskUsage: " <diskUsage>

                   "MaxDiskCapacity: "<maxDiskCapacity>

                   "Accounts:"

                   <listOfAccounts>

 

                   where <computerName>, <diskUsage>, <maxDiskCapacity> and <listOfAccounts> represent the field  

                   values associated with the computer.

      You should implement the classes in the following order: Account, Computer and finally AccountsManager.

Error Conditions

Each task have a set of possible errors that could occur. Your program is expected to detect and in some cases report the errors.  The description that follows specifies the errors  you are expected to report.  Error messages should be generated using JOptionPane.showMessageDialog.  After printing the error message, the current task will end and the task menu should be displayed to process the next user request.

You can assume that for other tasks and scenarios not covered by the above error conditions the user is providing the expected data and in the correct format.

Requirements

Sample Run

Keep in mind this is just an sample run.  Your code must work for other scenarios.

Starting the system and providing a computer name

After pressing OK and entering disk capacity

After pressing OK and entering 1

After pressing OK and entering account info

After pressing OK 

 

After pressing OK and entering 1

After pressing OK and entering account information

After pressing OK

After pressing OK and entering 5

After pressing OK

After pressing OK and entering 2

After pressing OK and entering tom

After pressing OK

After pressing OK and entering 4

After pressing OK and entering rosita

After pressing OK

After pressing OK and entering 3

After pressing OK and entering data

After pressing OK 

After pressing OK and entering 0

After pressing OK the program ends

 


Submission

Submit your project using the submit project option associated with Eclipse.  Remember to complete your time log before submitting your homework. 


Web Accessibility