Computer science
This presentation is the property of its rightful owner.
Sponsored Links
1 / 3

Computer Science PowerPoint PPT Presentation


  • 37 Views
  • Uploaded on
  • Presentation posted in: General

Computer Science. Errors & Debugging Structures & Loops. Avoiding Errors with if statements. Floating points are not good test values especially if you are using them for comparison Don’t forget to enclose Blocks of code in Brace brackets { }

Download Presentation

Computer Science

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


Computer science

Computer Science

Errors & Debugging

Structures & Loops


Avoiding errors with if statements

Avoiding Errors with if statements

  • Floating points are not good test values especially if you are using them for comparison

  • Don’t forget to enclose Blocks of code in

    • Brace brackets { }

  • Use the comparison operator == in if statements not the assignment operator =

  • Initialize values in if statements to take into account all eventualities

  • Use boolean operators correctly to combine conditions


Avoiding errors with loops

Avoiding errors with loops

  • For a counted loop use for

  • For a pre-test conditional loop use while

  • For a post-test conditional loop use do

  • For a counting and condition loop use for

  • Initialize all variables

  • Watch for infinite loops

  • Use boolean operators correctly to combine conditions


  • Login