SlideShare ist ein Scribd-Unternehmen logo
1 von 6
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>

Weitere ähnliche Inhalte

Ähnlich wie Javascript comparison and logical operators 2

Activity lesson
Activity lessonActivity lesson
Activity lesson
Max Friel
 
Javascript comparison and logical operators
Javascript comparison and logical operatorsJavascript comparison and logical operators
Javascript comparison and logical operators
Jesus Obenita Jr.
 
Javascript variables and datatypes
Javascript variables and datatypesJavascript variables and datatypes
Javascript variables and datatypes
Varun C M
 
Stuff you didn't know about action script
Stuff you didn't know about action scriptStuff you didn't know about action script
Stuff you didn't know about action script
Christophe Herreman
 

Ähnlich wie Javascript comparison and logical operators 2 (20)

Javascript notes
Javascript notesJavascript notes
Javascript notes
 
Java scripts
Java scriptsJava scripts
Java scripts
 
Js mod1
Js mod1Js mod1
Js mod1
 
Activity lesson
Activity lessonActivity lesson
Activity lesson
 
Php Lecture Notes
Php Lecture NotesPhp Lecture Notes
Php Lecture Notes
 
Javascript 101
Javascript 101Javascript 101
Javascript 101
 
2013-06-15 - Software Craftsmanship mit JavaScript
2013-06-15 - Software Craftsmanship mit JavaScript2013-06-15 - Software Craftsmanship mit JavaScript
2013-06-15 - Software Craftsmanship mit JavaScript
 
2013-06-24 - Software Craftsmanship with JavaScript
2013-06-24 - Software Craftsmanship with JavaScript2013-06-24 - Software Craftsmanship with JavaScript
2013-06-24 - Software Craftsmanship with JavaScript
 
Automated code audits
Automated code auditsAutomated code audits
Automated code audits
 
Php Basics Iterations, looping
Php Basics Iterations, loopingPhp Basics Iterations, looping
Php Basics Iterations, looping
 
Testing Code and Assuring Quality
Testing Code and Assuring QualityTesting Code and Assuring Quality
Testing Code and Assuring Quality
 
JSregularExpressions.pptx
JSregularExpressions.pptxJSregularExpressions.pptx
JSregularExpressions.pptx
 
JavaScript Training
JavaScript TrainingJavaScript Training
JavaScript Training
 
Javascript comparison and logical operators
Javascript comparison and logical operatorsJavascript comparison and logical operators
Javascript comparison and logical operators
 
Javascript variables and datatypes
Javascript variables and datatypesJavascript variables and datatypes
Javascript variables and datatypes
 
Stuff you didn't know about action script
Stuff you didn't know about action scriptStuff you didn't know about action script
Stuff you didn't know about action script
 
JavaScript
JavaScriptJavaScript
JavaScript
 
Popup boxes
Popup boxesPopup boxes
Popup boxes
 
How to test complex SaaS applications - The family july 2014
How to test complex SaaS applications - The family july 2014How to test complex SaaS applications - The family july 2014
How to test complex SaaS applications - The family july 2014
 
Clean & Typechecked JS
Clean & Typechecked JSClean & Typechecked JS
Clean & Typechecked JS
 

Mehr von Jesus Obenita Jr.

Session 2 test construction.mt's
Session 2   test construction.mt'sSession 2   test construction.mt's
Session 2 test construction.mt's
Jesus Obenita Jr.
 

Mehr von Jesus Obenita Jr. (20)

Organization and management 3 a Evolution of Management Theory
Organization and management 3 a Evolution of Management TheoryOrganization and management 3 a Evolution of Management Theory
Organization and management 3 a Evolution of Management Theory
 
Organization and management 2 Management Function
Organization and management 2 Management FunctionOrganization and management 2 Management Function
Organization and management 2 Management Function
 
Organization and management 1
Organization and management 1Organization and management 1
Organization and management 1
 
Designing web page marquee and img tag
Designing web page  marquee and img tagDesigning web page  marquee and img tag
Designing web page marquee and img tag
 
Ms excel 2013 formatting worksheets
Ms excel 2013 formatting worksheetsMs excel 2013 formatting worksheets
Ms excel 2013 formatting worksheets
 
Ms excel 2013 data management
Ms excel 2013 data managementMs excel 2013 data management
Ms excel 2013 data management
 
Microsoft Excel introduction
Microsoft Excel introductionMicrosoft Excel introduction
Microsoft Excel introduction
 
Word 2013 working with pictures
Word 2013 working with picturesWord 2013 working with pictures
Word 2013 working with pictures
 
Word 2013 Formatting Page
Word 2013 Formatting PageWord 2013 Formatting Page
Word 2013 Formatting Page
 
Word 2013 8
Word 2013 8Word 2013 8
Word 2013 8
 
Ms word 2013 7
Ms word 2013 7Ms word 2013 7
Ms word 2013 7
 
Ms word 2013 6
Ms word 2013 6Ms word 2013 6
Ms word 2013 6
 
Ms word 2013 4
Ms word 2013 4Ms word 2013 4
Ms word 2013 4
 
Ms word 2013 2
Ms word 2013 2Ms word 2013 2
Ms word 2013 2
 
Ms word 2013
Ms word 2013Ms word 2013
Ms word 2013
 
Parts of the ms word 2013 screen and
Parts of the ms word 2013 screen andParts of the ms word 2013 screen and
Parts of the ms word 2013 screen and
 
Word processor
Word processorWord processor
Word processor
 
Session 2 test construction.mt's
Session 2   test construction.mt'sSession 2   test construction.mt's
Session 2 test construction.mt's
 
Cooking ingredients
Cooking ingredientsCooking ingredients
Cooking ingredients
 
Color theory
Color theoryColor theory
Color theory
 

Kürzlich hochgeladen

1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
QucHHunhnh
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
QucHHunhnh
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
ZurliaSoop
 

Kürzlich hochgeladen (20)

Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptx
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
Magic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptxMagic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptx
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 

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>