Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

show it works The first part of this project requires that you implement a class that will be used to simulate a disk drive. The

show it works image text in transcribed
The first part of this project requires that you implement a class that will be used to simulate a disk drive. The disk drive will have numberofblocks many blocks where each block has blocksize many bytes. The interface for the class Sdisk should include : An explanation of the member functions follows : - Sdisk(diskname, numberofblocks, blocksize) This constructor incorporates the creation of the disk with the "formatting" of the device. It accepts the integer values numberofblocks, blocksize, a string diskname and creates a Sdisk (software-disk). The Sdisk is a file of characters which we will manipulate as a raw hard disk drive. The function will check if the file diskname exists. If the file exists, it is opened and treated as a Sdisk with numberofblocks many blocks of size blocksize. If the file does not exist, the function will create a file called diskname which contains numberofblocks* blocksize many characters. This file is logically divided up into numberofblocks many blocks where each block has blocksize many characters. The text file will have the following structure : - getblock(blocknumber,buffer) retrieves block blocknumber from the disk and stores the data in the string buffer. It returns an error code of 1 if successful and 0 otherwise. - putblock(blocknumber,buffer) writes the string buffer to block blocknumber. It returns an error code of 1 if successful and 0 otherwise. IMPLEMENTATION GUIDELINES : It is essential that your software satisfies the specifications. These will be the only functions (in your system) which physically access the

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

Advances In Knowledge Discovery In Databases

Authors: Animesh Adhikari, Jhimli Adhikari

1st Edition

3319132121, 9783319132129

More Books

Students also viewed these Databases questions

Question

1. Traditional and modern methods of preserving food Articles ?

Answered: 1 week ago

Question

What is sociology and its nature ?

Answered: 1 week ago

Question

What is liquidation ?

Answered: 1 week ago

Question

Explain the different types of Mergers.

Answered: 1 week ago