Write a complete C++ program that implements the followings: A. A class called Books. The class Books private data members should include: 1. Title: array of 30 char variables. 2. ISBN: pointer to an int variable. 3. Orders: array of 7 double variables. The class Books also should include the following public member functions: 4. For each data member: Title, ISBN, and Orders provide a parametrized Set function to store the received parameters for each one of them. 5. For each data member: Title, ISBN, and Orders provide an empty Get function to return the value for each one of them. 6. Provide the parametrized function TotalCost that returns the Orders summation multiplied by Price. Price a double parameter received by this function. B. The main function should include: 1. Definition for the object OBJ from the class Books. 2. Calling statements for the Set functions of the object OBJ. Prompt to the user to enter arguments to be passed for the functions. 3. Print the information for the object OBJ by calling the Get functions, and the TotalCost function. Prompt to the user to enter the arguments Price.
Write a complete C++ program that implements the followings: A. A class called Books. The class Books private data members should include: 1. Title: array of 30 char variables. 2. ISBN: pointer to an int variable. 3. Orders: array of 7 double variables. The class Books also should include the following public member functions: 4. For each data member: Title, ISBN, and Orders provide a parametrized Set function to store the received parameters for each one of them. 5. For each data member: Title, ISBN, and Orders provide an empty Get function to return the value for each one of them. 6. Provide the parametrized function TotalCost that returns the Orders summation multiplied by Price. Price a double parameter received by this function. B. The main function should include: 1. Definition for the object OBJ from the class Books. 2. Calling statements for the Set functions of the object OBJ. Prompt to the user to enter arguments to be passed for the functions. 3. Print the information for the object OBJ by calling the Get functions, and the TotalCost function. Prompt to the user to enter the arguments Price.
C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter12: Adding Functionality To Your Classes
Section12.2: Providing Class Conversion Capabilities
Problem 2E
Related questions
Question
Write a complete C++ program that implements the followings:
A. A class called Books. The class Books private data members should include:
1. Title: array of 30 char variables.
2. ISBN: pointer to an int variable.
3. Orders: array of 7 double variables.
The class Books also should include the following public member functions:
4. For each data member: Title, ISBN, and Orders provide a parametrized Set function to store the
received parameters for each one of them.
5. For each data member: Title, ISBN, and Orders provide an empty Get function to return the value for
each one of them.
6. Provide the parametrized function TotalCost that returns the Orders summation multiplied by Price.
Price a double parameter received by this function.
B. The main function should include:
1. Definition for the object OBJ from the class Books.
2. Calling statements for the Set functions of the object OBJ. Prompt to the user to enter arguments to be
passed for the functions.
3. Print the information for the object OBJ by calling the Get functions, and the TotalCost function. Prompt
to the user to enter the arguments Price.
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 2 steps with 4 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr