Question: Problem description : In this assignment, we will revisit Assignment #1. Mary has now created a small commercial library and has managed to collect sales

Problem description: In this assignment, we will revisit Assignment #1. Mary has now created a small commercial library and has managed to collect sales data. She wants to be able to print the books based on sales, and the list of authors based on their date of birth.

This assignment needs the structs Book, Author, Date, and Library.

Processing inventory: She wants to display the books by popularity, thus the program must print the books based on sales, from highest to lowest. You will need to save the output into a text file named OrderedBooks.txt. Utilize the Book struct to implement the desired functionality.

Similarly, Mary is interested in displaying the authors by age, printing the oldest authors first. An output filed OrderedAuthors.txt should be created. Appropriate operations must be implemented inside the Author struct, and properly use the Data struct to compare author ages.

Finally, utilize the Library struct to store the lists of authors and books, and contain the functionality that the librarian requires.

You must use both member functions and non-member functions. One of the Book or Author sorting mechanisms must be implemented via member function (you can choose which) and the other with a non-member function.

You must use constructors to initialize all data variables in structs with default values at the beginning of the program. Use of global variables will incur a deduction of 10 points from your total points.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!