How to design a library system


Please respond me as soon as possible regarding this as I'm new user
which is still not used to it and I don't know where or which part
to start


Thomas has newly opened a bookstore, selling at least four diffrent categories of books-
IT reference books, magazine, novels and cookerys books etc. He intends to
expand the variety of books that he in the near future.

In order to build better rapport with the customer, Thomas is setting up a 'Book
Lover's club to attaract customers to sign up as members to his bookstore. With this
'Book Lovers Club' , Thomas will be able to collect his customer's particular, as well
as their preference for books. To become a member, the cuatomer will have to pay
a yearly subscription of $10.

Thomas also intends to implement a saving scheme for his customers. For a customers who
are members of his 'Book Lovers Club',  they will enjoy a 3% discount when they purchase
any items in the bookstore. For members who have spent more than $1000 in a year, they
will be deemed as Godcard member, and they will enjoy 5% discount on any purchases
in the bookstore.

Thomas would like to implement an information system in keeping track of the sales of
each category of books. The system should also indicates the best and worst selling
category so that he can react to the market in time. Thomas would also like to computerise
the enrolment of memebrs into the 'Book's Lovers Club'.The system will keep a database of
members' particular and members' preference in books. Furthermore, the system
should also upgrade the members to gold card members when they qualify for it.

Write a pascal program to implement a information system that is suitable for
Thomas' bookstore. Indicate and explain clearly the type of data structure
used in developing the system.

Requirement from the lecturer:

Indicate and explain clearly the types of data structure using
- Array, linked list stack, queue


From
Verelyn

 
VerelynChanAsked:
Who is Participating?
 
BatalfConnect With a Mentor Commented:
They are wery restrictive here at EE about doing peoples homework, but we could probably guide you on your way.

First of all, you need some differents arrays :

eks Customer array which is an array of a record. The record could be something like this .

Customerrecord =
   custid : integer;
   lastname : string[25];
   firstname : string[25];
   adress : string[30];
   zipcode : string[6];
   phoneno : string[10];
   member : boolean; (* boolean = true or false. True if he/she is a member, false if not)
end;


the customer array should then be an array of this record :

  custommerarray = array[1..200] of customerrecord;

Then you probably need a bookarray which also is an array of a "record". (bookid, title, category, price etc.)

At last you would also need an array of sale, ex : saleno, customerid, date, totalprice. This array should contain an other array which is books. Reason: one sale are often containing more than one book.

This array is probably the mainarray.

When Thomas are selling some books, this is the array he are using. First of all he type in the customerid

(when the user type in the customer id, your system should search in the customer-array and return customerdata if it's found), if not you should type in new customer data, and store dem in the customerarray. The same thing for the bookarray. When you type in a booknumber, the system should go to the bookarray and search for it, and return the bookdata if it's found.

When Thomas sell one book, this book are from a category. Numbers of sold books of this category should therefor be increased. Ex: make a categoryarray of record, like this .

categoryrecord =
   categoryname : string[30];
   soldbooks : intger;
end;
category = array[1..10] of categoryrecord;

When a book has been sold you could use this command to increase no of sold books :

  inc(category[book[no].category])

  (bookno = the book he sold)

I think this should help you.

Conclusion :
Make some arrays :
   customers
   books
   category
   sale

Make some procedures for working with these arrays, eks : saleprocedure, adding a book procedure etc. and make some calls to this procedures from a menu. Ex  of a menu :

writeln('1..... New Customer ');
writeln('2..... New Book');
writeln('3..... Sale');
write('Type in your choice : ");
readln(choice); (*Choice should be a string[1]*)

case string of
  '1' : Newcustomer(* call to new customer procedure)
  '2' : New Book
....
....

....

Regards
Batalf


0
 
_lychee_Commented:
we can't do ur homework.
we CAN take ur input and offer suggestions on refinement tho...

so how about offering ur view on how u're gonna solve this problem first?

ie. ask more specific qns instead of the general "help me do this"...
0
All Courses

From novice to tech pro — start learning today.