Others
Assessment
CenterForComputing
ChatGPT
Search
Close
Log in
Register
CenterForComputing
You are here:
CenterForComputing
»
Syllabi
»
CSC121SylS2023
»
CSC121S2023Lab03
»
CSC121S2023Lab3H4
How to debug your program
29 Dec 2022 - 12:27
|
Version
1
|
UnknownUser
get it to compile
Comment out all code but your first loop that gets a valid input
Have it output the number when done. Run and fix it until it works.
Uncomment the code that does the counting.
Make sure that the loop for the correct input that is inside this loop is the same code as what you debugged first
Add code to output each of your counters inside the loop.
Run the code. Make sure it is counting correctly for each color and your total counter. Fix the code that you need to.
Uncomment your output code
See if it works now. If you are getting 0's, check a different hint.
If this is taking more than 15 minutes or you are getting frustrated, ask for help
When it works, remove all your debugging output statements
Attachments
($count)
Show options
Search:
Sort by:
Name
Date
Author
Size
Type
Results per page:
6
12
24
48
all
Display hidden:
More actions
Create link(s)
Embed
Download
Hide
Unhide
Move
Delete
0
attachment(s)
Select all
Clear all
Copyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki?
Send feedback
This website is using cookies.
More info
.
That's Fine