We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
// Write your MyBook class hereclassMyBook:Book{intprice;// Class Constructor// // Parameters:// title - The book's title.// author - The book's author.// price - The book's price.//// Write your constructor herepublic:MyBook(stringtitle,stringauthor,intprice):Book(title,author){this->price=price;}// Function Name: display// Print the title, author, and price in the specified format.//// Write your method herevoiddisplay(){cout<<"Title: "<<title<<endl;cout<<"Author: "<<author<<endl;cout<<"Price: "<<price<<endl;}// End class};
Day 13: Abstract Classes
You are viewing a single comment's thread. Return to all comments →
c++