JAVASCRIPT COMPARISON ANDLOGICAL OPERATORSPART 2  BENJAMIN B. ESGUERRA MEMORIAL NATIONAL HIGH SCHOOL
CHECKING ASSIGNMENT/REVIEW<html>                       <html><body>                       <body><script>                  ...
CHECKING ASSIGNMENT/REVIEW<html><body><script>var user1= prompt(“What is the first calculating device?   Abacus or Comptom...
Identify if correct or error.                           Source code  If error ,find code/s or missing codes that will caus...
If error ,find code/s or missing codes that will cause                           error.7. var x= prompt(What is kbps stand...
DECLARING VARIABLES IN ONE STATEMENT and USING LOGICAL OPERATOR (or)||<html><body><script>var x= prompt("Who created the J...
Upcoming SlideShare
Loading in …5
×

Javascript comparison and logical operators 2

390 views

Published on

Published in: Education
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
390
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
3
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Javascript comparison and logical operators 2

  1. 1. JAVASCRIPT COMPARISON ANDLOGICAL OPERATORSPART 2 BENJAMIN B. ESGUERRA MEMORIAL NATIONAL HIGH SCHOOL
  2. 2. CHECKING ASSIGNMENT/REVIEW<html> <html><body> <body><script> <script>var age1= 50 var age1= 50var age2= 68 var age2= 68var age= (age1<age2) var age= (age1==age2 &&age2==age1>alert(“”+age+””); alert(“”+age+””);document.write(“”+age+””); document.write(“”+age+””);</script> </script></body> </body></html> </html>
  3. 3. CHECKING ASSIGNMENT/REVIEW<html><body><script>var user1= prompt(“What is the first calculating device? Abacus or Comptometer?”,””);var answ1= “Abacus”var con1= (user1==answ1)? “Congratulation”:”Try Again”;confirm(“Are you sure with your answer? ”);alert(“”+con1+”’);document.write(“Correct Answer”+con1+””);document.write(“Your answer” +user1+””);</script></body></html>
  4. 4. Identify if correct or error. Source code If error ,find code/s or missing codes that will cause error.1. var name= parseFloat(prompt(“Enter name of the item”,” “));2. var price= parseFloat(prompt(“Enter the amount”,” “));3. Alert(The “+name+” is sold “+price” pesos””);4. Var 4thyear=prompt(“Enter the number of 4th year students”,” “);5. Document.write(“The “+Name+” is sold “+Price” pesos””);5. var distance= parsefloat(prompt(“Enter distance”,”);
  5. 5. If error ,find code/s or missing codes that will cause error.7. var x= prompt(What is kbps stand for? “ ,””);8. Var y= “kilobytes per seconds”9. var z= (x==y) Correct: Wrong ;10. Confirm(Are you sure);11. msdocument.wrirte(The correct answer is “+z+”);12. var x= parsefloatprompt(What number is less than10? “,”)
  6. 6. DECLARING VARIABLES IN ONE STATEMENT and USING LOGICAL OPERATOR (or)||<html><body><script>var x= prompt("Who created the JavaScript? "," ");var y= "Brendan Eich", n= "brendan eich", m= "Brendan"var z= (x==y||x==n||x==m)?"Correct": "Wrong";alert(""+z+"");document.write("Correct Answer: "+y+"");</script>

×