Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please help me!. I don't know where to start. Thanks Program description Introduction You are helping the library catalog books, and provide books to departments

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

Please help me!. I don't know where to start. Thanks

Program description Introduction You are helping the library catalog books, and provide books to departments upon request.. The librarian received new shipments of books with different ISBN weekly, they also receive requests for new books with different ISBN numbers in either new, used, or digital format. (ISBN: this is the number the publisher assigns An ISBN is assigned to each edition and variation of a book) For example the Library may receive a shipment of 5 books S cat newbooks.dat 55, new 66, used 67, digita 01, new 2, digital Scat request.dat 67, digital 67, new Programing Assignment: Create a program SearchNewBooks.cc that given as command line input newbooks.dat and request.dat and a method of search either binary or linear, creates a file of the number of books found from the request list $SearchNewBooks newbooks.dat request.dat //run program $Choice of search method ([l]inear, [blinary)? CPU time: 10.777 microseconds cat found.dat Written: By running the program multiple times and with inputs of different size explain the pros and cons of linear search versus sorting first and using binary search, with respect to computational complexity. Try to explain if it is possible to determine a ratio between the number of new books and the number of requests to search, that makes either linear search or binary search the best option. Constraints Your program must be compatible with C++ only use the standard functions provided by the C++ Standard Library Your program cannot be linked to any other external libraries (e.g., Boost) Your code must follow the Google C++Style Guide and be properly commented when necessary . create_testData: a program that generates fake datasets in order to test your program with inputs of various sizes It expects two command line arguments when being run: o The number of newBooks to generate in the output newbooks.dat file The number of requested books to generate in the output requests.dat file . o For example: $create testData 5 3 $ ls newbooks.dat newbooks.dat $ create testData 5 3 $ cat newbooks.dat 58,new 92,used 82,digital 114,used 26,new $ cat request.dat 8,new 1,new 95,new CPPLINT.py cpplint, the C++ linter developed by Google to ensure that code conform:s to their style guide. With this python file located in the same directory as your program, you can run the linter as shown in the example below and fix the reported warnings: $python cpplint.py SearchNewBooks.cc Done processing SearchNewBooks.cc Total errors found: 0 Makefile Write a simple Makefile that generates the executable SearchNewBooks from the file SearchNewBooks.cc, using g++ The compiler should be run with the -Wall (enable all warnings) and -Werror (treat all warnings as errors) options. There should also be a clean rule that removes any generated files (executables, datasets, etc.) and puts the directory back in its original state. Phase 1: reading in the dataset In this phase, your program should receive two filenames as command line arguments, the new books file and request file, which the program should read in. The list of new books and list of requested books should should be stored in only two std: vector containers. Because some code to open these two files will probably be equivalent, you are encourage to write generic functions in order to avoid code duplication New Books file The first file contains a list new books identified by ISNB number and type, one per line. Each line has an integer values and a string. Example of new books file: Scat newBooks.dat 58,new 92,used ECS 36C Winter 2019 Due: Jan 23, 2019 82,digital 114,used 26,new You should write a class for representing book as a combination of both the ISNB number and type, so that each vector is an object of that class. For debugging purposes, you can overload the 1/ NOLINT (build/c++11) std::chrono:high_resolution_clock::time_point start; start- std:chrono::high _resolution_clock::nowO .../ some computation happening */ auto end = std::chrono : :high resolution. clock.. now(); double elapsed-us-std.chrono..durationdouble, std..micro>(end-start).count(): std:cout $ ./SearchNewBooksh toto Usage: .SearchNewBooks snewBooks.dats

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

Datacasting How To Stream Databases Over The Internet

Authors: Jessica Keyes

1st Edition

007034678X, 978-0070346789

Students also viewed these Databases questions

Question

Explain the process of MBO

Answered: 1 week ago