How to program ?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • lavender
    New Member
    • Feb 2007
    • 12

    How to program ?

    Please help me to answer the below task!!!!


    The algorithm for a buffer of a printing device that will spool data sent to be printed using a queue data structure is described below.
    The printer has a buffer size that can hold up to 10 data in one particular time. It will only print when the queue have at least 5 data (and it will print 5 data simultaneously) .
    Use the related operations for the queue data structure to develop this program.
    Example of outputs that the program must fulfill is as shown below:

    Example Output 1:
    ****Printer Spooling****
    1 - send document for printing
    2 - printing document
    3 - exit
    Please choose one :
    7
    Error : Please choose the correct one


    Example Output 2:
    ****Printer Spooling****
    1 - send document for printing
    2 - printing document
    3 - exit
    Please choose one :
    1
    Enter ID document to printing: 234


    Example Output 3:
    ****Printer Spooling****
    1 - send document for printing
    2 - printing document
    3 - exit
    Please choose one :
    2
    Check programming buffer...
    Number in bufer: 1
    Error : not enought 5 document
  • horace1
    Recognized Expert Top Contributor
    • Nov 2006
    • 1510

    #2
    post the code your have written so far with a description of the problems and we will try to help!

    Comment

    • srinub4u
      New Member
      • Mar 2007
      • 1

      #3
      Can you please give me the clue to start writing this code :(

      Thanq


      Originally posted by horace1
      post the code your have written so far with a description of the problems and we will try to help!

      Comment

      • horace1
        Recognized Expert Top Contributor
        • Nov 2006
        • 1510

        #4
        Originally posted by srinub4u
        Can you please give me the clue to start writing this code :(

        Thanq
        can you use the STL queue?
        http://www.cppreferenc e.com/cppqueue/index.html
        http://msdn2.microsoft .com/en-us/library/s23s3de6(VS.80) .aspx

        or do you have to write you own?

        Comment

        Working...