Sample Exam 2

Problem 1


For this problem, the project can be found in the folder SE2-2a.

For this problem, the main program  makes assumptions about how the class Book works. Your job is to write a class called Book that meets these assumptions.


Output:

Bookstore Demo

The title of this book is Computing Concepts
and the author of this book is Horstmann
The cost of this book is $69.95
Currently, this book has 200 in stock.

The title of this book is Calculus
and the author of this book is Thomas
The cost of this book is $39.0
Currently, this book has 5 in stock.

Some sales are being made

The title of this book is Computing Concepts
and the author of this book is Horstmann
The cost of this book is $69.95
Currently, this book has 181 in stock.

The title of this book is Calculus
and the author of this book is Thomas
The cost of this book is $39.0
Currently, this book has 4 in stock.