• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Javascript comparison and logical operators 2
 

Javascript comparison and logical operators 2

on

  • 476 views

 

Statistics

Views

Total Views
476
Views on SlideShare
476
Embed Views
0

Actions

Likes
0
Downloads
0
Comments
0

0 Embeds 0

No embeds

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

    Javascript comparison and logical operators 2 Javascript comparison and logical operators 2 Presentation Transcript

    • JAVASCRIPT COMPARISON ANDLOGICAL OPERATORSPART 2 BENJAMIN B. ESGUERRA MEMORIAL NATIONAL HIGH SCHOOL
    • 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>
    • 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>
    • 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”,”);
    • 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? “,”)
    • 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>