Design and implement a c class which represents a book and


Assignment

Book Class

Design and implement a C++ class which represents a Book, and use this class in a main program which reads in information for multiple books from a data file and outputs them in a nice format to display what books are available for purchase.

Requirements

A book has a title, an author (first and last names), a format (Hardcover, Paperback, Ebook, Audiobook), a publishing date, and a price. NOTE: This should be a number since we will use it later to calculate the total cost of our purchases.

As for member functions, you will want one (or more) constructor functions for this class, a Display function (nicely formatted, no more than 2 output lines per book), and "Get" and "Set" functions for each data member ("Get" functions are functions that return a particular data member, "Set" functions are functions that use a parameter value to set the value of a particular data member).

The main program will read a line from the file, process the data into a book, and display the book until you reach the end of the file. The algorithm for the main program is as follows:

Open input file and check to see that it opened

Read one line containing book information

While not at the end of the file

Process one line of information into a book

Display the book

Read one line containing book information

Close the file

When implementing this algorithm, each step should either be one line of code or a function call. Later on, we will reuse our Book class in another main program for the next project. BE SURE TO SAVE A COPY OF IT.

Submission Guidelines

All source code must include program purpose, your name, date, and other comments, be properly indented and use descriptive variable names where appropriate. Submit a zipped file of your Project folder. This will include your main program (MainBook.cpp) and your class files (Book.h and Book.cpp) as well as the correct directory structure and project files, to the Programming Problem 3 drop box in D2L. I will be looking at the code and running the program from your project. Your grade will depend on how it compiles and runs, if the desired output is produced, and programming style.

Ethical Programming Guidelines

· This is an individual assignment; the work you turn in must be yours and yours alone.

· You are free to share conceptual ideas (BUT NOT CODE) with fellow students without any computing device present.

· You are free to use any example code provided by the instructor.

· You can consult SIs and the instructor for assistance with your code, but you must have your algorithm written before you will get help.

· You may NOT share code with another student.

· You may NOT "team" code.

· You may NOT coach code another student.

· You may NOT solicit help from the Internet (forums, crowd-source your project).

Solution Preview :

Prepared by a verified Expert
C/C++ Programming: Design and implement a c class which represents a book and
Reference No:- TGS02548194

Now Priced at $95 (50% Discount)

Recommended (92%)

Rated (4.4/5)