CS 225 Program 4

CS 225 Fall 1999 Assignment 4 Points: 50 Due Date: October 12, 1999


This will make a little database of books. You will create a structure containing at least the following fields:
title    a character array of 32 characters
pages    an integer
cost    a float

You should make an array of these and prompt the user for input, using a loop. You need to make at least 3.
To get the input you can use cin like this.

cin >> mystruct.title;
Then whatever title is typed will show up in the title. Don't enter spaces.
The same kind of thing works for integers and floats.

Then, write a loop that looks at each structure and prints out the title, pages and cost. It should also
sum up the count of pages and the total cost. Don't assume the length of the array, get it from your input loop.

Hand in the listing. Be sure to explain your method in the comments.