OW)
Answer the following questions.
Q. No. 1. Write a program to manage the book store in which there is a class BOOK with
data members BookID. Title, Author, price and quantity. It also contains the follow
member functions:
Input () function is used to input the values of data members.
Display O function is used to display the values.
Purchase () function is used to add to numbers of books in quantity.
.
Sold () function is used to minus from the number of books from the quantity
book
Create an object of BOOK Input the values in data members of object and then display
data of object. In main () function, also use switch statement to prompt the user for cho
of operations either to purchase or sell a book. Sold ( function must also check the quan
available to sell (8)
Answers
Answer:
ppose that you want to assemble your own PC, you go to a hardware store and pick up a motherboard, a processor, some RAMs, a hard disk, a casing, a power supply, and put them together. You turn on the power, and the PC runs. You need not worry whether the motherboard is a 4-layer or 6-layer board, whether the hard disk has 4 or 6 plates; 3 inches or 5 inches in diameter, whether the RAM is made in Japan or Korea, and so on. You simply put the hardware components together and expect the machine to run. Of course, you have to make sure that you have the correct interfaces, i.e., you pick an IDE hard disk rather than a SCSI hard disk, if your motherboard supports only IDE; you have to select RAMs with the correct speed rating, and so on. Nevertheless, it is not difficult to set up a machine from hardware components.
Similarly, a car is assembled from parts and components, such as chassis, doors, engine, wheels, brake, and transmission. The components are reusable, e.g., a wheel can be used in many cars (of the same specifications).
Hardware, such as computers and cars, are assembled from parts, which are reusable components.
How about software? Can you "assemble" a software application by picking a routine here, a routine there, and expect the program to run? The answer is obviously no! Unlike hardware, it is very difficult to "assemble" an application from software components. Since the advent of computer 60 years ago, we have written tons and tons of programs. However, for each new application, we have to re-invent the wheels and write the program from scratch.
Explanation:
i hope it's helpful for you