CSE 461 Project I The first part of this project

CSE 461 Project I

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 :

Class Sdisk

{

public :

Sdisk(string diskname, int numberofblocks, int blocksize);

int getblock(int blocknumber, string& buffer);

int putblock(int blocknumber, string buffer);

int getnumberofblocks(); // accessor function

int getblocksize(); // accessor function

private :

string diskname;        // file name of software-disk

int numberofblocks;     // number of blocks on disk

int blocksize;          // block size in bytes

};

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 : Bytes 0 – blocksize-1Block 0Bytes blocksize – 2*blocksize-1Block 1Bytes 2*blocksize – 3*blocksize-1Block 2……Bytes ?-?Block numberofblocks-1
  • 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 Sdisk. NOTE that you must also write drivers to test and demonstrate your program.

Share This Post

Email
WhatsApp
Facebook
Twitter
LinkedIn
Pinterest
Reddit

Order a Similar Paper and get 15% Discount on your First Order

Related Questions

Social cognition is about perceiving others and how we process

  Social cognition is about perceiving others and how we process the people and the world around us.  How do people categorize things and people as either familiar and safe or unfamiliar and possibly dangerous?  Why do people categorize?  Can you escape categorization?  How does this impact us and how

How did a $9 Billion Health Tech Startup End up

  How did a $9 Billion Health Tech Startup End up DOA?   Please read the paper by Ernesto Dal Bo & Guo Xu: cited above. Is this a case of hype, myth, deception, lack of scientific understanding, none of the above, or all of the above? From a consulting

Analyze these controversial issues based on your review of this

  Analyze these controversial issues based on your review of this week’s required Learning Resources. In your Assignment, do the following: Present an argument for your stance with respect to the first controversial issue regarding substance-related disorders: Is it possible for individuals with substance-related disorders, such as those who abuse

In this project, you will develop a detailed comparative analysis

  In this project, you will develop a detailed comparative analysis of cloud vendors and their services. A comparative analysis provides an item-by-item comparison of two or more alternatives, processes, products, or systems. In this case, you will compare the pros/cons of the cloud service providers in terms of security,

Suppose you are the IT manager for an IT company.

 Suppose you are the IT manager for an IT company. You receive a report that contains a list of computer equipment stored in the company warehouse. You notice that the list also includes items that you know are not stored in the warehouse. Would you consider this list as good

Each state within the United States has its own unique

Each state within the United States has its own unique judicial selection process within its own court system. Each state also has unique steps that can be taken to remove a judge from office for disciplinary reasons. In this assignment, you will detail your state’s judicial selection and removal process.

1000 word, APA 6 format, in-text citation, at least 2

1000 word, APA 6 format, in-text citation, at least 2 references, plagiarism-free work.  Using the following case from **Chapter 7 of your textbook, write a paper of 1,000 words or more using APA style and at least 2 references (one of which should be the textbook). **Chapter7 case study attached below**

Present the age-related Physiologic or Psychologic Disorder Choose from one:

Present the age-related Physiologic or Psychologic Disorder Choose from one: Integumentary function, Urinary function, Musculoskeletal function or Endocrine function. Describe the age-related changes and common problems and conditions. Summarize the nursing management appropriate for your Physiologic or Psychologic Disorder chosen   Submission Instructions: Presentation is original work and logically organized. 

In this journal, you will share your reflections on your

  In this journal, you will share your reflections on your time in PSY101 by answering the questions below. For each of the questions, write a paragraph-length response (5-7 sentences). 1.As a result of this class, how will you immediately apply your problem solving skill at home or work? Write

Case 1 Misplaced Affections: Discharge for Sexual Harassment, Pages 116

  Case 1Misplaced Affections: Discharge for Sexual Harassment, Pages 116 (Chapter 3 ). . Read the Case Study entitled, “Misplaced Affections: Discharge for Sexual Harassment”       several times to get a good understanding of the case…   Write a COVER PAGE, then, write a short summary of the case, then,  answer all of the

Purpose of Assessment Develop specific strategies with supporting tactics to

Purpose of AssessmentDevelop specific strategies with supporting tactics to implement positive change within an organization. You may refer to the information that you prepared in Week 5 to complete this assignment, but your submission should add to your prior research and not just copy your Week 5 assignment. Scenario: You’ve been

Please create a document where you will answer the following

Please create a document where you will answer the following questions- (400-500 words total) 1. How do you define ethics in the context of health promotion communication? 2.  Explain the difference between ethics and morality  3. Outline a guide for making ethical decisions  4. Identify ethical issues associated with the

Read the Chapter 20 Mini Case in Financial Management: Theory

Read the Chapter 20 Mini Case in Financial Management: Theory and Practice. Using complete sentences and academic vocabulary, please answer question B. Paul Duncan, financial manager of EduSoft Inc., is facing a dilemma. The firm was founded 5 years ago to provide educational software for the rapidly expanding primary and secondary

This exercise includes installation instructions, data, and a tutorial. The tutorial requires students to work with the County Health Ranking dataset and assess the proportion of uninsured in CA count Nursing Assignment Help

This exercise includes installation instructions, data, and a tutorial. The tutorial requires students to work with the County Health Ranking dataset and assess the proportion of uninsured in CA counties. Students will create a geospatial map, a bar plot, and a dashboard. There is a word document that offers step-by-step instructions