Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

C++ Program problem

Tags:
  1. Jun 12, 2015 #1
    Untitled.png
     
  2. jcsd
  3. Jun 12, 2015 #2
    I cannot Understand the marked lines
     
  4. Jun 12, 2015 #3

    Mark44

    Staff: Mentor

    The lines in blue in your image pretty well explain what is happening in the pseudocode. Are you having trouble understanding the problem description?
     
  5. Jun 13, 2015 #4
    No I understand the description. But I don't understand the form of writing the code . Why in the first line he wrote units -500 and why in the second line he wrote units - 1000
     
  6. Jun 13, 2015 #5

    FactChecker

    User Avatar
    Science Advisor
    Gold Member

    "every unit in excess of 1000" is (units - 1000)

    So the code is a direct translation of the description above.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook