Created
April 10, 2019 06:03
-
-
Save Shadowking1235/e33bafadac635eeb4e88971b8cee9c25 to your computer and use it in GitHub Desktop.
JS Bin // source https://jsbin.com/gesoyi
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<script id="jsbin-javascript"> | |
/****Homework Assignment #3: Statements and Operators | |
//Details: | |
Let's look at a popular logical argument (a syllogism) | |
All men are mortal | |
Socrates is a man. | |
Therefore, socrates is mortal. | |
Using "if statements" and any other logical operators and data-types | |
you see fit, recreate this logical argument. | |
Your code should make clear that "socrates" is part of a collection of items referred to as "men", and that all members of this collection are mortal. You should also then demonstrate that since Socrates is part of this collection, it follows that he is mortal as well. | |
Extra Credit: | |
Got the hang of creating a logical argument? Want to try another one? Try this one as well: | |
This cake is either vanilla or chocolate. | |
This cake is not chocolate. | |
Therefore, this cake is vanilla. | |
****/ | |
"use strict"; | |
var objectMen = { | |
man1: "Johnson", | |
man2: "paul", | |
man3: "socrate" | |
}; | |
console.log(objectMen); | |
console.log(objectMen.man3); | |
var socrate = "Socrate"; | |
var allMenAreMortal = true; | |
var SocrateIsAMen = true; | |
var SocrateIsMortal = true; | |
if (SocrateIsAMen === SocrateIsMortal) { | |
console.log('All men are mortal'); | |
console.log('Socrate is a man'); | |
console.log('Socrate is mortal'); | |
} else if (socrate === SocrateIsMortal) { | |
console.log('All men are mortal'); | |
console.log('Socrate is not man'); | |
} else { | |
console.log('All men are not mortal'); | |
console.log('Socrate is not a man'); | |
console.log('Socrate is not mortal'); | |
} | |
var Vanilla = true; | |
var Chocolate = true; | |
if (Vanilla || isChocolate) { | |
console.log('This cake is either vanilla or chocolate'); | |
if (Chocolate === true) { | |
console.log('This cake is not chocolate'); | |
console.log('Therefore,this cake is vanilla'); | |
} | |
} | |
</script> | |
<script id="jsbin-source-javascript" type="text/javascript">/****Homework Assignment #3: Statements and Operators | |
//Details: | |
Let's look at a popular logical argument (a syllogism) | |
All men are mortal | |
Socrates is a man. | |
Therefore, socrates is mortal. | |
Using "if statements" and any other logical operators and data-types | |
you see fit, recreate this logical argument. | |
Your code should make clear that "socrates" is part of a collection of items referred to as "men", and that all members of this collection are mortal. You should also then demonstrate that since Socrates is part of this collection, it follows that he is mortal as well. | |
Extra Credit: | |
Got the hang of creating a logical argument? Want to try another one? Try this one as well: | |
This cake is either vanilla or chocolate. | |
This cake is not chocolate. | |
Therefore, this cake is vanilla. | |
****/ | |
var objectMen = | |
{ | |
man1: "Johnson", | |
man2: "paul", | |
man3: "socrate", | |
} | |
console.log(objectMen) | |
console.log(objectMen.man3); | |
var socrate = "Socrate"; | |
var allMenAreMortal = true; | |
var SocrateIsAMen = true; | |
var SocrateIsMortal = true; | |
if(SocrateIsAMen === SocrateIsMortal) | |
{ | |
console.log('All men are mortal'); | |
console.log('Socrate is a man'); | |
console.log('Socrate is mortal'); | |
} | |
else if(socrate === SocrateIsMortal ) | |
{ | |
console.log('All men are mortal'); | |
console.log('Socrate is not man'); | |
} | |
else | |
{ | |
console.log('All men are not mortal'); | |
console.log('Socrate is not a man'); | |
console.log('Socrate is not mortal'); | |
} | |
const Vanilla = true; | |
const Chocolate = true; | |
if(Vanilla || isChocolate) | |
{ | |
console.log('This cake is either vanilla or chocolate'); | |
if | |
(Chocolate === true) | |
{ | |
console.log('This cake is not chocolate'); | |
console.log('Therefore,this cake is vanilla'); | |
} | |
} | |
</script></body> | |
</html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/****Homework Assignment #3: Statements and Operators | |
//Details: | |
Let's look at a popular logical argument (a syllogism) | |
All men are mortal | |
Socrates is a man. | |
Therefore, socrates is mortal. | |
Using "if statements" and any other logical operators and data-types | |
you see fit, recreate this logical argument. | |
Your code should make clear that "socrates" is part of a collection of items referred to as "men", and that all members of this collection are mortal. You should also then demonstrate that since Socrates is part of this collection, it follows that he is mortal as well. | |
Extra Credit: | |
Got the hang of creating a logical argument? Want to try another one? Try this one as well: | |
This cake is either vanilla or chocolate. | |
This cake is not chocolate. | |
Therefore, this cake is vanilla. | |
****/ | |
"use strict"; | |
var objectMen = { | |
man1: "Johnson", | |
man2: "paul", | |
man3: "socrate" | |
}; | |
console.log(objectMen); | |
console.log(objectMen.man3); | |
var socrate = "Socrate"; | |
var allMenAreMortal = true; | |
var SocrateIsAMen = true; | |
var SocrateIsMortal = true; | |
if (SocrateIsAMen === SocrateIsMortal) { | |
console.log('All men are mortal'); | |
console.log('Socrate is a man'); | |
console.log('Socrate is mortal'); | |
} else if (socrate === SocrateIsMortal) { | |
console.log('All men are mortal'); | |
console.log('Socrate is not man'); | |
} else { | |
console.log('All men are not mortal'); | |
console.log('Socrate is not a man'); | |
console.log('Socrate is not mortal'); | |
} | |
var Vanilla = true; | |
var Chocolate = true; | |
if (Vanilla || isChocolate) { | |
console.log('This cake is either vanilla or chocolate'); | |
if (Chocolate === true) { | |
console.log('This cake is not chocolate'); | |
console.log('Therefore,this cake is vanilla'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Syllogism