Hello, I want to create a program that can calculate and print bills in a restaurant or a coffe-shop, and I don't know how to do the print part and what library I would need.
Hello, I want to create a program that can calculate and print bills in a restaurant or a coffe-shop, and I don't know how to do the print part and what library I would need.
Decide on the Operation System (OS).
Decide on the Printer.
Post the information and maybe someone can help you; note it will NOT be me; The printers I know about are over 20 years old.
Tim S.
"...a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are,in short, a perfect match.." Bill Bryson
let's say I want to make a program for this :
Panasonic JS 790WS POS Touchscreen Register System with Printer Cash Drawer | eBay
Are you trying to get a graphic type of print out, or the much more common text only type of receipt? The text only type is vastly simpler and faster. I don't recall ever seeing any other kind, personally. Also, it's portable from one printer to the other.
Do you have the list of items being offered by the coffee shop, and the price of each item, in a data file or database?
ye text only type of receipt.
I'm thinking about a struct and scan the price and other information about each item in the first use of the program.
"...a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are,in short, a perfect match.." Bill Bryson
You want something permanent. Worst thing is to have to enter several items each time you start the program, while you're trying to develop and test it.
So in a file:
coffer large 1.00
coffee small 0.80
coke small 1.00
coke large 1.50
etc.
You can use Notepad or any plain text editor for it, easily. If you use an editor that inserts format codes into the file, you just need to export it into a file "As plain text".
In windows, it works easiest if you use the dot txt file name extension.
Then the format for each struct is:
Why int? Because you will find it easiest to always get your prices right, including the change back, etc. when you use an int.Code:struct item { char name[30]; char size[30]; int price; }
coffee large 100;
etc.
Read that in from a file, into an array of items, and you'll be underway.
If you need more info on C, run through the "C Tutorial" here - it's really excellent. Click on it at the top of this forum, and get into it!.
it is a commercial project.
Then tell your boss to hire someone competent to do the job.
Or offer some money on Freelancer Acquires vWorker
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
honestly, because i program POS`s for businesses, when you get a POS, like the most basic one i just did monday, or even the touchscreen one you mentioned, it is already set up with the software to run and print reciepts, as well as all the front end functions, including the communications software to send, and be controlled from the back end. are you trying to use there program, or a full re-write of the software? if it is a complete rewrite, then you need to pick the OS your going to use as the shell, once you decide on that, then you need to figure out how the screen, drawer and printer are accessed, for example, some POS`s are accessed by ip address on a network, while others are jumpers set and called by "register1", "register2", "printer1", "printer2", while even a handfule are both networked with an ip, but accessed ONLY by the software name you set the hardware to. no matter how you do it, using the orig software would be a start, just leanr how the software works, if you want to dump there software, you have alot of learning and research to do to make your own POS Shell, which depending on the POS, could take a while. Not to mention chances are it will not be portable from POS to POS unless there all the same systems.