Difference: CSC121S2023Lab3H4 ( vs. 1)

Revision 12022-12-29 - cathybareiss

Line: 1 to 1
Added:
>
>
META TOPICPARENT name="CSC121S2023Lab03"

How to debug your program

  1. get it to compile
  2. Comment out all code but your first loop that gets a valid input
  3. Have it output the number when done. Run and fix it until it works.
  4. Uncomment the code that does the counting.
    1. Make sure that the loop for the correct input that is inside this loop is the same code as what you debugged first
    2. Add code to output each of your counters inside the loop.
    3. Run the code. Make sure it is counting correctly for each color and your total counter. Fix the code that you need to.
  5. Uncomment your output code
    1. See if it works now. If you are getting 0's, check a different hint.
  6. If this is taking more than 15 minutes or you are getting frustrated, ask for help
  7. When it works, remove all your debugging output statements
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback