Concept explainers
(a)
To choose a suitable word for a blank.
(a)
Explanation of Solution
Answer: Files
Explanation: A file is a collection of data that is stored in the storage devices.
(b)
To choose a suitable word for a blank.
(b)
Explanation of Solution
Answer: Record
Explanation: The data can be stored in the form of the fields in the record.
(c)
To choose a suitable word for a blank.
(c)
Explanation of Solution
Answer: Key
Explanation: To retrieve the data from the record, something unique is required, that is, a key.
(d)
To choose a suitable word for a blank.
(d)
Explanation of Solution
Answer: String
Explanation: A set of characters is known as a string.
(e)
To choose a suitable word for a blank.
(e)
Explanation of Solution
Answer: Standard input, standard output, and standard error
Explanation: These are the basic streams required for the file operations.
(f)
To choose a suitable word for a blank.
(f)
Explanation of Solution
Answer: fputc
Explanation: A fputc() is a pre-defined function to write a character to the file.
(g)
(g)
Explanation of Solution
Answer: fputs
Explanation: A fputs() is a pre-defined function to write a string to the file.
(h)
To choose a suitable word for a blank.
(h)
Explanation of Solution
Answer: fwrite
Explanation: Generally, a fwrite() function is used to write to a file.
(i)
To choose a suitable word for a blank.
(i)
Explanation of Solution
Answer: fseek
Explanation: A fseek() function will move the pointer to the starting of the file.
Want to see more full solutions like this?
Chapter 11 Solutions
C How to Program (8th Edition)
- using c++ and use pointer and char(don't use string): Write a class date (d, m, y), class file (name, size, creation_date) and class directory (name, directory_creation_date, array[files])Write the constuctors, destructors, set, get methods for each classCreate a directory object and fill it with its required data Find the size of the created directory object.arrow_forwardFile system implementation: a. Given a flename in a directory’s data block, how does OS locate the data block of a fle? b. Compare between direct pointers and indirect pointers in referencing data blocks. c. Given a 6GB fle, identify the number of index level needed when using indirect pointer.arrow_forwardDont use answers from others please! MIPS source programs and the screenshots of your MARS execution windows. Name: .asciiz "James Bond!"Age: .byte 24Numbers: .word 11, 22, 33Letter1: .asciiz 'M' 2. Create the data declaration part of the above by creating a file with MARS and assemble it to show the memory contents. You don't have to have .text part since this is just data declaration only. Capture your screen of MARS execution window by checking "ASCII" option of Data Segment part.arrow_forward
- You are given a file called “std” and composed of “Number, Name, Address” fields. (You can define the type of fields by yourself) Write an algorithm that makes “insert, delete, update and retrieve”, processes on the records in the file. “Number” field is the key of each record. Here is the template of report: Steps Actions 1 Name of the report and date 2 Author of report Literature review Your contribution 5 Explanation algorithm and sub algorithms 6 Summary Future advice References ps: write a algorithm not a programarrow_forwardYou are given a file called “std” and composed of “Number, Name, Address”fields/attributes. (You can define the type of fields by yourself) Write an algorithm thatmakes “insert, delete, update and retrieve”, processes on the records in the file. “Number”field is the key of each record.Here is the template of report:Steps Actions1 Name of the report and date2 Author of report3. Literature review4. Your contribution5 Explanation algorithm and sub algorithms6 Summary7. Future advice8. Referencesarrow_forwardCOMPLETE TO DO's (do not copy other responses to this question if you do ill downvote) recv.cpp #include <stdio.h>#include <stdlib.h>#include <string.h>#include <fcntl.h>#include <mqueue.h>#include <sys/stat.h>#include <sys/types.h>#include <sys/mman.h>#include <unistd.h>#include <signal.h> // The name of the shared memory segment#define MSQ_NAME "/cpsc351queue" // The name of the file where to save the received file#define RECV_FILE_NAME "file__recv" #define MQ_MSGSIZE 4096 /*** Receive the file from the message queue*/void recvFile(){ // TODO: Define a data structure // of type mq_attr to specify a // queue that can hold up to 10 // messages with the maximum message // size being 4096 bytes // The buffer used to store the message copied // copied from the shared memory char buff[MQ_MSGSIZE]; // The total number of bytes written int totalBytesWritten = 0; // The number of bytes written int…arrow_forward
- I have to create a program that will create a database when using geo points. I will include a previous program and the instructions: You are going to change program 8 so that instead of reading in a list of five or more points from a file you will read the points in from a database. Create a program the will create your database and insert at least five points. Use your own data, something like: 100, 200, 123, Main Campus 120, 133, 142, Montoya 153, 123, 322, Rio Rancho 133, 123, 143, STEMULUS Center 153, 142, 122, ATC Run your initialization code to create the database. Modify your GUI program from program 8 so that it reads points from your database instead of a file. Turn in the initialization code, the database and your new GUI program.arrow_forwardComputer system there is a total of 16 blocks with file occupying the following set of block number : f1(1,12,6,9,14,2) F2(10,3) F3(7,15,4) Do allocation with indexed allocation method with 3 direct pointers and one index block pointer، draw the file directory and blocks on diskarrow_forward1)Assume an index record occupies 8 bytes (4 for key, 4 for disk pointer). What is the size and number of blocks read to find a record for the following primary index configurations: Dense, primary index Sparse, primary indexarrow_forward
- -Inventory given through picture -Language from C++03 The fill will have the following specifications: Each record consists of two lines. The first line contains the name of the product, which may be more than one word long. The second line contains the wholesale price as a decimal, the markup as a percentage, and three quantities, for counter, shelf, and warehouse. If the first line of a record contains the word END all by itself, that is the end of the file. Your task is to read each record into the program, as a string for the name, and numbers for the price and markup, and as an array of numbers for the quantities. Then calculate the total profit for each item: (wholesale price) * (markup, converted into a decimal) * (total quantity). Print out a report on one line for each item: Name, total profit. Format the output nicely: names should fit in 30 characters and the prices should line up and should have two decimal places. Hints: You’ll want to use getline to read multi-word…arrow_forwardState which of the following are true and which are false. If false, explain why.d) If the file position pointer points to a location in a sequential file other than the beginningof the file, the file must be closed and reopened to read from the beginning of the file.arrow_forwardWith linked allocation, each file is a linked list of disk blocks; the disk blocks may be scattered anywhereon the disk. The directory contains a pointer to the first and last blocks of the file. Each block contains a pointerto the next block. Refer to the illustration below. Need help to fill in the codes in void main() --- #include<stdio.h>#include<stdlib.h>#define TOTAL_DISK_BLOCKS 32#define TOTAL_DISK_INODES 8int blockStatus[TOTAL_DISK_BLOCKS]; // free = 0int blockList[TOTAL_DISK_BLOCKS - TOTAL_DISK_INODES]; // list of blocks of a filestruct file_table {char fileName[20];int fileSize;struct block *sb;};struct file_table fileTable[TOTAL_DISK_BLOCKS - TOTAL_DISK_INODES];struct block {int blockNumber;struct block *next;};int AllocateBlocks(int Size) {---}void main(){int i = 0, j = 0, numFiles = 0, nextBlock= 0, ret = 1;char s[20]; struct block *temp;---for(i = 0; i < numFiles; i++) {---ret = AllocateBlocks(fileTable[i].fileSize);---}---//Seed the pseudo-random number…arrow_forward
- C++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology PtrEBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT