Need Help with Beginner Program

This is a discussion on Need Help with Beginner Program within the C++ Programming forums, part of the General Programming Boards category; I have finished other elements of the program, but I am not sure where to go on this one. Yes ...

  1. #1
    Registered User
    Join Date
    Aug 2012
    Posts
    11

    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
    Posts
    2,692
    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.

    Jim

  3. #3
    Registered User
    Join Date
    Dec 2011
    Posts
    795
    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, 09: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, 03:36 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21