SlideShare a Scribd company logo
JAVASCRIPT COMPARISON AND
LOGICAL OPERATORS
PART 2
  BENJAMIN B. ESGUERRA MEMORIAL NATIONAL HIGH SCHOOL
CHECKING ASSIGNMENT/REVIEW
<html>                       <html>
<body>                       <body>
<script>                     <script>
var age1= 50                 var age1= 50
var age2= 68                 var age2= 68
var 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 than
10? “,”)
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>

More Related Content

PPTX
Javascript conditional statements 1
PPS
Ave mar a_1_1_._
PDF
Excel tips
PPS
Revolu
PPS
Pr sentation 03
PDF
Seja feliz sso
PPT
Fundamentals of computer output devices
PPT
Javascript1
Javascript conditional statements 1
Ave mar a_1_1_._
Excel tips
Revolu
Pr sentation 03
Seja feliz sso
Fundamentals of computer output devices
Javascript1

Similar to Javascript comparison and logical operators 2 (20)

DOCX
Javascript notes
RTF
Java scripts
PPT
PPT
Activity lesson
PPT
Php Lecture Notes
PPTX
Javascript 101
PDF
2013-06-15 - Software Craftsmanship mit JavaScript
PDF
2013-06-24 - Software Craftsmanship with JavaScript
PDF
Automated code audits
PPTX
Php Basics Iterations, looping
PDF
Testing Code and Assuring Quality
PPTX
JSregularExpressions.pptx
PPT
JavaScript Training
PPTX
Javascript comparison and logical operators
PPSX
Javascript variables and datatypes
PDF
Stuff you didn't know about action script
PPT
JavaScript
PPTX
Popup boxes
PDF
How to test complex SaaS applications - The family july 2014
PDF
Clean & Typechecked JS
Javascript notes
Java scripts
Activity lesson
Php Lecture Notes
Javascript 101
2013-06-15 - Software Craftsmanship mit JavaScript
2013-06-24 - Software Craftsmanship with JavaScript
Automated code audits
Php Basics Iterations, looping
Testing Code and Assuring Quality
JSregularExpressions.pptx
JavaScript Training
Javascript comparison and logical operators
Javascript variables and datatypes
Stuff you didn't know about action script
JavaScript
Popup boxes
How to test complex SaaS applications - The family july 2014
Clean & Typechecked JS
Ad

More from Jesus Obenita Jr. (20)

PPTX
Organization and management 3 a Evolution of Management Theory
PPTX
Organization and management 2 Management Function
PPTX
Organization and management 1
PPTX
Designing web page marquee and img tag
PPTX
Ms excel 2013 formatting worksheets
PPTX
Ms excel 2013 data management
PPTX
Microsoft Excel introduction
PPTX
Word 2013 working with pictures
PPTX
Word 2013 Formatting Page
PPTX
Word 2013 8
PPTX
Ms word 2013 7
PPTX
Ms word 2013 6
PPTX
Ms word 2013 4
PPTX
Ms word 2013 2
PPTX
Ms word 2013
PPTX
Parts of the ms word 2013 screen and
PPTX
Word processor
PPT
Session 2 test construction.mt's
PPTX
Cooking ingredients
PPTX
Color theory
Organization and management 3 a Evolution of Management Theory
Organization and management 2 Management Function
Organization and management 1
Designing web page marquee and img tag
Ms excel 2013 formatting worksheets
Ms excel 2013 data management
Microsoft Excel introduction
Word 2013 working with pictures
Word 2013 Formatting Page
Word 2013 8
Ms word 2013 7
Ms word 2013 6
Ms word 2013 4
Ms word 2013 2
Ms word 2013
Parts of the ms word 2013 screen and
Word processor
Session 2 test construction.mt's
Cooking ingredients
Color theory
Ad

Recently uploaded (20)

PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PDF
01-Introduction-to-Information-Management.pdf
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PDF
Insiders guide to clinical Medicine.pdf
PDF
Pre independence Education in Inndia.pdf
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PPTX
Renaissance Architecture: A Journey from Faith to Humanism
PPTX
PPH.pptx obstetrics and gynecology in nursing
PPTX
Institutional Correction lecture only . . .
PPTX
master seminar digital applications in india
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PDF
Complications of Minimal Access Surgery at WLH
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PPTX
Cell Structure & Organelles in detailed.
PDF
Classroom Observation Tools for Teachers
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PDF
TR - Agricultural Crops Production NC III.pdf
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
01-Introduction-to-Information-Management.pdf
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
Module 4: Burden of Disease Tutorial Slides S2 2025
Insiders guide to clinical Medicine.pdf
Pre independence Education in Inndia.pdf
FourierSeries-QuestionsWithAnswers(Part-A).pdf
Renaissance Architecture: A Journey from Faith to Humanism
PPH.pptx obstetrics and gynecology in nursing
Institutional Correction lecture only . . .
master seminar digital applications in india
human mycosis Human fungal infections are called human mycosis..pptx
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
Complications of Minimal Access Surgery at WLH
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
Cell Structure & Organelles in detailed.
Classroom Observation Tools for Teachers
102 student loan defaulters named and shamed – Is someone you know on the list?
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
TR - Agricultural Crops Production NC III.pdf

Javascript comparison and logical operators 2

  • 1. JAVASCRIPT COMPARISON AND LOGICAL OPERATORS PART 2 BENJAMIN B. ESGUERRA MEMORIAL NATIONAL HIGH SCHOOL
  • 2. CHECKING ASSIGNMENT/REVIEW <html> <html> <body> <body> <script> <script> var age1= 50 var age1= 50 var age2= 68 var age2= 68 var 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. 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. 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. 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 than 10? “,”)
  • 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>