Reference no: EM132105019
Problem Statement:
This program will read books from an input file into your library data structure. A library consists of a list of books that can be in sorted or unsorted order.
As books are read in from the input file, just add them to an internal array that holds books. You will provide two methods on this Library for sorting books after they are read in from the data file. One sort function should sort by the publication year of the books.
The other should sort by the author of the book. One of your sorts should be written using SELECTION SORT. The other should be written with MERGESORT. You must write your own sort code. Do not use any built in C++ libraries for sorting.
Requirements:
You must be able to add books to your Library using an add method.
You must be able to sort your books in two manners using appropriate methods.
You must be able to display the books in the library after sorting using a print or display method.
You are not required to delete books from the list.
You must prompt the user for the name of an input file to read the books from.
Your list must be able to store at least 100 books. (Use arrays, not linked lists, - so that you can write a mergesort).
You may display your lists to the screen or to an output file. It is your choice. If you use an output file, allow the user to enter the name of the file.
Sample Output:
We The Living
Rand, Ayn
1936
The Sparrow
Russell, Mary Doria
1996
Foundation
Asimov, Isaac
1951
Hyperion
Simmons, Dan
1989
The Fifth Season
Jemison, N. K.
2015
Kindred
Butler, Octavia
1979
Watership Down
Adams, Richard
1972
How many possible games of tic-tac-toe are there
: Show the whole game tree starting from an empty board down to depth 2 (i.e., one X and one O on the board), taking symmetry into account.
|
How do international corporations utilize
: How do international corporations utilize the media to enhance the public image of the firm during crisis?
|
Calculate the break even point
: a) Calculate the Break Even Point(BEP) in units of output and sales(RM) using the contribution margin method
|
Calculate the revised break-even point
: The projected sales for the following year for products X, Y, and Z are $800,000, $500,000 and $900,000 respectively. Calculate the revised break-even point (in
|
Provide two methods on this library for sorting books
: Provide two methods on this Library for sorting books after they are read in from the data file.
|
Discussing the importance of accreditation
: Discussing the importance of accreditation and credentialing, strategies for quality improvement, and the role of statistics and statistical forecasting
|
Variant of undirected hamilton path
: The language in question is the set of all triples (G, s, t) for which G is an undirected graph with maximum degree at most 2 containing a Hamilton path.
|
Plastic bottles for medicinal product
: A company manufactures various-sized plastic bottles for its medicinal product. The manufacturing cost for small bottles is $75 per unit
|
How many of them has 3 or 8 as one of its digits
: For integers between 1 and 1000, how many of them are divisible by 3 or 8? How many of them are divisible by 4 or 6?
|