Click here to Skip to main content
15,867,756 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi all

I got a work of printing transactions in a passbook.
printing part is fine but how to keep track of the line number printed at passbook..??

e.g. bank has a limit of 10 transactions per page..
last printed in a page is 4 line.

so next time it should start from 5th line..


Please need some idea how to do that..
Posted
Updated 21-Nov-16 8:49am

1 solution

I guess you have some sort of abstraction/class that represents a transaction or collection of transactions (and I mean collection generically).

I guess you'll also need an abstraction for a passbook, that keeps the number of pages, number of transactions per page (eg 10 in your case), last page used, last line used etc - this could be extended for example, if the 1st page was a 'passbook owners details' page

You'd likely need to serialize the passbook class so it can be stored, or have a database mapping layer or such

The printer class then uses an instance of the passbook class, with data loaded from file/disk/deserialzed, and an instance of the transactions.....

It really doesn't seem hard
 
Share this answer
 
Comments
[no name] 20-Feb-14 0:33am    
Can you give me some example..??i need some code or reference link..
Garth J Lancaster 20-Feb-14 2:27am    
no ... this smells like homework, and we don't do homework - try - sketch out a couple of classes - post them back here and people will help - they wont help if you expect everyone else to do your work

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900