Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Use Microsoft Visual Studio 2017 C++ to complete. This is part 1 of a two part program. In part 1 you will create and test

Use Microsoft Visual Studio 2017 C++ to complete. This is part 1 of a two part program. In part 1 you will create and test the BookClass that you will use in Topic 11 to implement your Library program. Requirements: 1. Create BookClass.h with the following: Member variables: title. A string that holds the books title author. A string that holds the books author publisher. A string that holds the books publisher isbn. A string that holds the books ISBN number price. A double that holds the books price year. An int that holds the year when the book was published numInStock. An int that holds the number of copies of this book Member functions void storeBook(string bookTitle, string authorName, string bookPublisher, string bookISBN, double bookPrice, int bookYear, int booksInStock) o Stores the parameters into the BookClass member variables void displayBookInfo() Displays the contents of the BookClass member variables void checkOutBook() Subtracts 1 from the numInStock member variable; tests to make sure numInStock is not 0 void returnBook() Adds 1 to the numInStock member variable string getTitle() Returns the value in title int getNumInStock() Returns the value in numInStock 2. Create BookMain.cpp to test your BookClass. Functions: void getBookInfo (BookClass &); o Asks the user to enter information for one book, then invokes member function storeBook to store the information in the BookClass variable. Test your class and function with a main program: Call getBookInfo to store the book information into the BookClass variable Call CheckOutBook Call getTitle to get the books title Call getNumInStock to get the number of copies currently in stock Display the books title and number of copies in stock Call returnBook Call getTitle to get the books title Call getNumInStock to get the number of copies currently in stock Display the books title and number of copies in stock 3. HINT: You need to use getline to input string data that contains spaces. 4. IMPORTANT: When using getline following the use of cin with numeric input, you need to use cin.ignore() to skip over the end of line character or you will get into an infinite loop. 5. Output must be labelled and easy to read

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

Database Security

Authors: Alfred Basta, Melissa Zgola

1st Edition

1435453905, 978-1435453906

More Books

Students also viewed these Databases questions