Okay I been out of the game for awhile, I forgot how to put the users input into the function when working with classes. Even the damn lingo for coding I'm rusty on so bare with me.
#ifndef ACTION_H
#define ACTION_H
usingnamespace std;
class action
{
public:
action();
int getNumberOfBooks();
string getSection();
string getBookName();
int getRating();
void displayInfo();
private:
int numberOfBooks;
string section;
string bookName;
int rating;
};
#endif // ACTION_H
#include <iostream>
#include "action.h"
usingnamespace std;
int main()
{
action Info;
string answer;
cout << "What book are you interested in? ";
getline(cin, answer);
//HOW TO PUT THIS ANSWER INSIDE OF OUR GETBOOKNAME SHIT...
return 0;
}
#include <iostream>
#include "action.h"
usingnamespace std;
// GETS NUMBER OF BOOKS
int action::getNumberOfBooks()
{
return numberOfBooks;
}
//GETS SECTION OF BOOK
string action::getSection()
{
return section;
}
//GETS BOOK NAME
string action::getBookName()
{
return bookName;
}
//GETS BOOK RATING
int action::getRating()
{
return rating;
}
//THIS GATHERS ALL INFO THE USER TYPES THEN DISPLAYS IT
void action::displayInfo()
{
cout << "You said there is: " << numberOfBooks << " books in the library.\n";
cout << "The section is: " << section << ".\n";
cout << "Book name is: " << bookName << ".\n";
cout << "Rating of that book is: " << rating << ".\n";
}
//DON'T WORRY ABOUT
action::action()
{
}