Book Database Implementation C++

carl123
Messages
55
Reaction score
0
1.PNG
2.PNG


I began by creating 2 classes. A book class and a course class that contains any necessary info about the book and course respectively

Code:
class bookClass{
    private:
        string theISBN;
        string thebookName;
        string thebookAuthor;
        double thebookCost;
        int thebookEdition;
        char bookFormat;
       
       
    public:
       
}

class courseClass{
    private:
        string deptCode;
        string courseName;
        int courseNum;
        int secNum
       
    public:
       
}

I'm new to C++. This is how I've began and not sure how to continue. My question are as follows:

1. Am I on the right track so far?
2. If so, what is the public supposed to contain for each class?
3. How do I store to user input in vectors that should hold the book information

I'm not requesting for the solution to be handed to me. I just need a nudge in the right direction. Thanks
 
carl123 said:
View attachment 211059 View attachment 211060

I began by creating 2 classes. A book class and a course class that contains any necessary info about the book and course respectively

Code:
class bookClass{
    private:
        string theISBN;
        string thebookName;
        string thebookAuthor;
        double thebookCost;
        int thebookEdition;
        char bookFormat;
      
      
    public:
      
}

class courseClass{
    private:
        string deptCode;
        string courseName;
        int courseNum;
        int secNum
      
    public:
      
}

I'm new to C++. This is how I've began and not sure how to continue. My question are as follows:

1. Am I on the right track so far?
Pretty much. The private members of your class represent the data for a given book or course.
carl123 said:
2. If so, what is the public supposed to contain for each class?
The public members of each class should be the methods that operate on the data. Users of the class will need to call the class methods for various operations, rather than directly manipulate the class data members. This is called data hiding.
carl123 said:
3. How do I store to user input in vectors that should hold the book information
You don't, as I read the problem. You will need a function that takes a string of one or two characters, and then calls the appropriate method, passing the information that the method needs, as parameters to the method. I don't see any requirement to store user input in a vector. However, after each book instance is created, it should be stored in a vector or array. You'll need to do the same for each course instance that you construct.
carl123 said:
I'm not requesting for the solution to be handed to me. I just need a nudge in the right direction. Thanks
 

Similar threads

  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 9 ·
Replies
9
Views
3K
  • · Replies 7 ·
Replies
7
Views
7K
  • · Replies 16 ·
Replies
16
Views
5K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K