Describing the processing of each command

Assignment Help Data Structure & Algorithms
Reference no: EM133680814

Library Inventory Database

Write a program that maintains a list of books for a library. The program must accept commands to make insertions and deletions in this list, while simultaneously maintaining the list in alphabetical order for three string type keys: Subject. Author, and Title.

Input
1. The book information created in previous executions of this program, if any, is stored in the text file "books.txr. Each book's information is on three consecutive lines. The format of each line is described in the table below:

Line

Information

1

Book Title

2

Author (last name, first name)

3

Subject

2. The program inputs commands from the user (keyboard) to insert, delete. list by key, and quit. You are free to implement the "user interface" part of the program as you wish, as long as it is easy to use.

Output
1. The results of each operation should be written to the screen. In addition, transaction information describing the processing of each command should be written to an output file. (For instance, for an Insert command, the output file should contain the title. author. and subject information, as well as the location where the record was inserted and the location of its entry in each ordering array.) The information in the output file should be neatly formatted and clearly labeled.

2. The "books.txt" text file should be rewritten to contain the updated book information.

Data Structures
The records containing information about each book (subject. author. and title strings) must be stored in an array. These records may be stored in consecutive array slots in the order in which they are inserted. For example, if the book information is stored in an array called bookData, bookData[0] contains information about the first book inserted, bookData[1] contains information about the second book inserted and so on.

The list must be maintained in order by title, in order by author, and in order by subject by using arrays of pointers (indexes), one for each key. For instance, suppose the key order information is stored in arrays of KeyOrderType, as described below:
typddef int[MAX_BOOKS] KeyOrderType; titleOrder : KeyOrderType;
authorOrder : KeyOrderType;
subjectOrder : KeyOrderType:

The zeroth array slot contains the index of the first book record with the appropriate key. For example. titleOrder[0] indicates the index of the book that comes first alphabetically by title. If titleOrder[0] = 5, then bookData[5) contains the first alphabetical title. The next book, in alphabetical order by title, would be found in the bookData array at the index indicated by titleOrder[1]. For index >= 0, fitleOrder[index]contains the index in bookData of the next title in the alphabetic ordering. The authorOrder and subjectOrder arrays work similarly. (The arrays may be bound together in a struct. if you wish. They are described here as separate entities only for clarity.)

Reference no: EM133680814

Questions Cloud

Critical thoughts about policy or procedure : Think about a government decision you disagree with. Just think of the last time you had critical thoughts about a policy or procedure.
Discuss the five challenges in detail : For this discussion, discuss these five challenges in detail. Identify a method of overcoming each of these challenges as a health care leader.
Civil rights advocates against PATRIOT Act : What are some objections held by civil rights advocates against the PATRIOT Act?
Explain how electronic health records and mobile health : Explain how electronic health records, mobile health, patient portals, or telemedicine can impact and be impacted by the social determinants of health.
Describing the processing of each command : Describing the processing of each command should be written to an output file. (For instance, for an Insert command, the output file should contain the title
Difference between becoming federal judge-texas state judge : Describe the difference between becoming a federal judge and becoming a Texas state judge.
What cultural influences affect the health of asian american : What cultural influences affect the health of Asian Americans? Discuss the health behaviors of Asian Americans and how those behaviors affect their health.
What are the benefits of certification : Reflect in your journal entry on key features of the consensus model and the significance of national certification. What are the benefits of certification?
Fatigue-shortness of breath on exertion-jaw pain : Mr. Rosen is an established patient. He has been seen for fatigue, shortness of breath on exertion, jaw pain, back pain, dizziness, and light-headedness.

Reviews

len3680814

4/22/2024 11:07:04 PM

Hello, could you write this in microsoft visual studio? I will attach the sortedType.cpp in another message. Thank you

Write a Review

Data Structure & Algorithms Questions & Answers

  How to implement the class as two stacks

Suppose that you want to add the find Min (but not delete Min) operation to the stack repertoire. Implement this class as two stacks, as described in Exercise.

  Create a recursive backtracking solution

The columns and rows of the matrix are the regions while the cells contain a 0 if the two regions are not adjacent and a 1 if they border. Create a recursive backtracking solution which accepts as interactive input from the user the number of regi..

  Exact bounds for distributed graph colouring

Exact bounds for distributed graph colouring and Prepare an abstract for your final project - Emphasis is not on length but rather on quality of the final product.

  Question 1you are required to provide suitable examples of

question 1you are required to provide suitable examples of your own for each part of the question where appropriateai

  Determine the constraints that will affect these goals

Determine if a wireless solution will support the low delay that will be needed to meet the needs of the applications. Defend your answer. Determine the security concerns you should bring up as you design the network upgrade.

  Write algorithms to perform the following operations on it

Write algorithms to perform the following operations on it - create, insertion, deletion, for testing overflow and empty conditions.

  Create all the possible combinations of array a

The subset-sum problem is defined as follows: given a set B of n positive integers and an integer K, can you find a subset of B whose elements' summation is equal to K? Design an algorithm to solve this problem. Address its correctness and running..

  Write a program that maintains a list of books

Write a program that maintains a list of books for a library. The program must accept commands to make insertions and deletions in this list

  Demonstrate implementation of appropriate data structure

CDDS2103 Introduction To Data Structures, Open University Malaysia - demonstrate the implementation of appropriate data structure using C language to solve

  What are the properties of an algorithm

What is a first-in-first-out data structure ? Write algorithms to perform the following operations on it - create, insertion, deletion, for testing overflow and empty conditions.

  How many codewords are there in an even weight code

How many codewords are there in an even-weight code of length n? - Find C⊥ for the even-weight code C of length n.

  Explain why your algorithm is correct

Give an O(log n) algorithm to find an integer from [1, m] that is not present in A and find the smallest such integer. Explain why your algorithm is correct.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd