Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
03-30-2009, 12:30 PM #1
- Join Date
- Mar 2009
- Thanked 0 Times in 0 Posts
simulator for managing of files on a disk.
How to create this disk simulator?can u do this using java?
Disk space is a valuable resource which should be used sparingly. When a file is brought in to a
computer it saves all the data contained in to the disk. Managing files in a disk is a interesting
task. Initially the all the available disk space is in kept in a pool which can be represented by a
linked list (the space does not have to be contiguous). When a file is saved the space is taken
from the pool and the allocation is maintained at the files end with another linked list
You are required to implement a simulator for managing of files on a disk. Please follow the
guidelines given below.
Define the disk as an array of size numberOfSectors*sizeOfSector, sizeOfSector refers
to the amount of characters stored in one sector. As for this assignment we will resolve to
have 100 sectors with each holding 4 characters.
The structure of the linked list node should be identified and it does not have to be the
same for both the lists
Implement the methods to save and delete files.
Since the allocated sectors might not be contiguous (this phenomenon is known as
fragmentation ) retrieval of the file from the disk can be very badly affected. You are
required to write method which would remove file fragmentation from the disk.
Name of the Java class should be FileManagementSim
The array should be named disk and the two linked lists should be named pool and file
The method signatures of the above operations should be save(String filename) ,
delete(String filename) and defragment(). You can have any number of methods you
want but these three methods with there respective signatures are mandatory.
The complete source code should be written in a single file . Once you have tested your
program remove the main method from it before submitting.
03-30-2009, 01:57 PM #2
- Join Date
- Sep 2002
- Saskatoon, Saskatchewan
- Thanked 2,668 Times in 2,637 Posts
Given you're criteria for note 5, yep its supposed to be in Java.
This is clearly a homework assignment. We cannot do you're work for you, but we can answer any specific questions. Do you have any?PHP Code:
header('HTTP/1.1 420 Enhance Your Calm');
Users who have thanked Fou-Lu for this post:
03-31-2009, 03:03 AM #3
- Join Date
- May 2006
- Ontario, Canada
- Thanked 20 Times in 20 Posts
You know, maybe we should take posts in the above form (OP's post); Where nothing more than the assignment description is given and move them all into a single thread. That way when the occasional person who actually wants to learn to program posts a thread like "I want to learn give me some projects to try" we can just point them to the thread with a list of other peoples assignment questions.
Users who have thanked Gox for this post: