Errors in coding
Upcoming SlideShare
Loading in...5
×
 

Errors in coding

on

  • 5,473 views

 

Statistics

Views

Total Views
5,473
Views on SlideShare
367
Embed Views
5,106

Actions

Likes
0
Downloads
0
Comments
0

7 Embeds 5,106

http://assumptionmaya3.wordpress.com 5081
https://assumptionmaya3.wordpress.com 8
http://assumptionmaya3.wordpress.com. 6
http://ww2.assumptionmaya3.wordpress.com 4
http://translate.googleusercontent.com 3
http://wwww.assumptionmaya3.wordpress.com 2
http://google.assumptionmaya3.wordpress.com 2
More...

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Errors in coding Errors in coding Presentation Transcript

  • Finding errors in code To become better at coding we must learn to find errors in the code. There are several things to look for in particular. *remember that if the code is missing one small then it will not work.
  • Semi-colon;  Always make sure a semi-colon is at the end of a statement for example-  document.write("grade is a");  numb1=parseInt(numb1);
  • Upper case and lower case  Words used must be identical or will not work, for example-  numb1=parseInt(NUMB3); (wont work)  numb1=parseInt(numb1); will work
  • Open and closing tags </>   You must ensure you close the html, body and script tags for the code to work, for example</html> </body> </script>
  • Quotation marks “”    Quotation marks must be in the () brackets when there is a word/sentence to be displayed for examplevar marks = prompt("enter the marks of test",""); (will work) var marks = prompt(enter the marks of test,); (won't work)
  • Copy the following codes into notepad and fix to make work <html><body><script type="text/javascript"> var marks = prompt("enter the marks of test",""); marks=(marks); if(marks=60) { document.write("grade is a") } else ^ (marks >=45) { document.write("grade is b }
  • Continued... else if(marks >=30) { document.write(grade is c") } else ^ document.write("grade is f"); } </script> </body>
  • <html> <script type="text/javascript"> var numb= prompt(enter a number to find it's square root") numb=parseInt(); var Result=numb*numb document.write("The square root is" , Result); </script> <body> </html>
  •  <html>  <body>  <script type="text/javascript">    var numb1=prompt("enter the adjacent of triangle?") var numb^=prompt("enter the opposite of triangle?") var numb3=prompt("enter the longest side/hypotenuse of triangle?");  numb1=parseInt(NUMB)  numb2=parseInt(numb2);
  • Continued... numb3=parseInt(numb; var Result=(numb1*numb1+numb2*numb2!=numb3); ^ (Result^=numb3) { document.write (this is not right triangle"); } else { document.write ("this is right triangle"); }