practice: bibliography generator

Practice topic: intro to structures (or classes). Finish each part before starting the next one.

part 1

Create a structure (or a class) called Book to hold info about a book including the title, author, year of publication, and publisher. In your main function, create a variable of type Book and then read user inputs about a book. For example,

Enter title: The Hitchhiker's Guide to the Galaxy
Enter author: Douglas Adams
Enter year of publication: 1979
Enter publisher: Pan Books

Then, have the program format this following the MLA style and display it:

Adams, Douglas. _The Hitchhiker's Guide to the Galaxy_. Pan Books, 1979.

(You can just put underscores around anything that should be italicized.)

part 2

Change your Book variable in your main function to be an array of books (choose any size 2 or greater). Get inputs for each book, and sort the books alphabetically by the author's last names. Then print the entire bibliography.

part 3

Create a way to assign genres to books. There are multiple options for how to do this. For example, you could create a new structure called Genre, or you could add a new member variable to the Book structure. Try to come up with at least one more option, think about the pros and cons for each of these options, and try implementing at least one of them.