Thread: Need Help with Beginner Program

  1. #1
    Registered User
    Join Date
    Aug 2012

    Thumbs up Need Help with Beginner Program

    I have finished other elements of the program, but I am not sure where to go on this one. Yes I am a beginner. I don't know how to perform these divisions with leftovers and such and how to make it all work. Any help would be appreciated.

    Determine and report the number of large, medium, and small pizzas you need to order
    For every 7 guests, order one large pizza
    For every 3 guests left over, order one medium pizza
    For every 1 guest left over, order one small pizza

    And i know the modulus operator "%", but I just can't seem to put everything together ha

  2. #2
    Registered User
    Join Date
    May 2010
    Also don't forget that when you use integers in calculations there are no fractions, so 1/2 will yield zero. You may be able to use this fact in concert with the modulus operator to help solve your problem.


  3. #3
    Registered User
    Join Date
    Dec 2011
    You should use a "greedy" algorithm.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. C Program beginner
    By striderx240 in forum C Programming
    Replies: 15
    Last Post: 01-26-2012, 10:17 PM
  2. Help beginner with program please
    By bubbles56 in forum C Programming
    Replies: 1
    Last Post: 03-23-2011, 10:37 PM
  3. Beginner, cant get my program to run :-(
    By leahknowles in forum C Programming
    Replies: 5
    Last Post: 03-23-2011, 03:44 PM
  4. Beginner C++ Help. My very first program.
    By Jechob in forum C++ Programming
    Replies: 2
    Last Post: 10-10-2010, 01:34 PM
  5. Beginner C++ Program Help
    By jensklemp in forum C++ Programming
    Replies: 4
    Last Post: 01-28-2010, 04:36 PM