Thread: Help needed.

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Jul 2013
    Posts
    4

    Help needed.

    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.

  2. #2
    Registered User
    Join Date
    May 2009
    Posts
    4,183
    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

  3. #3
    Registered User
    Join Date
    Jul 2013
    Posts
    4

  4. #4
    Registered User
    Join Date
    Sep 2006
    Posts
    8,868
    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?

  5. #5
    Registered User
    Join Date
    Jul 2013
    Posts
    4
    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.

  6. #6
    Registered User
    Join Date
    May 2009
    Posts
    4,183
    Quote Originally Posted by otawara View Post
    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.
    So it is just a student assignment; I was thinking about a real commercial project.

    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

  7. #7
    Registered User
    Join Date
    Sep 2006
    Posts
    8,868
    Quote Originally Posted by otawara View Post
    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.
    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:
    Code:
    struct item {
    char name[30];
    char size[30];
    int price;
    }
    Why int? Because you will find it easiest to always get your prices right, including the change back, etc. when you use an int.

    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!.

  8. #8
    Registered User
    Join Date
    Jul 2013
    Posts
    4
    it is a commercial project.

  9. #9
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,666
    Quote Originally Posted by otawara View Post
    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.

  10. #10
    Registered User
    Join Date
    Dec 2012
    Posts
    307
    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.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Help needed.
    By Locusy in forum C Programming
    Replies: 2
    Last Post: 11-29-2011, 03:20 PM
  2. some help needed here
    By n3cr0_l0rd in forum C++ Programming
    Replies: 8
    Last Post: 07-29-2009, 10:38 AM
  3. Help needed :-(
    By adrian.mowrey in forum C Programming
    Replies: 22
    Last Post: 07-27-2009, 05:10 PM
  4. help needed
    By striped bass in forum C Programming
    Replies: 5
    Last Post: 12-05-2005, 09:39 PM
  5. C++ help needed?
    By atif in forum C++ Programming
    Replies: 2
    Last Post: 04-28-2002, 06:43 PM