Book Class UML Assignment
Book Class UML Assignment
#include <string>
using namespace std;
class Book {
private:
string title;
string author;
double price;
public:
// Constructor
Book(string t, string a, double p) {
title = t;
author = a;
price = p;
}
int main() {
Book b1("Object-Oriented Programming", "John Smith", 45.99);
b1.showDetails();
b1.setPrice(50.00);
cout << "\nUpdated Price: $" << b1.getPrice() << endl;
return 0;
}