Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
@cloudsxvx
The hint is to take the "is Socrates" human exercise, and create a function for each proposition.
You then combine them together to make an executable function that returns true or false for is Socrates human. -
cloudsxvx594y@SortOfTested that makes more sense than the way so basically just make a function that combines all of it to say true or false ?
-
@cloudsxvx
Yeah, they want you to express the same logic in the previous exercise, but as executable logic.
Basically take your pseudo code and make it real code.
Don't forget to check whether the arguments are valid. -
cloudsxvx594y@SortOfTested function testMortality(humansName){
const humanName = ["socrates", "aristotle", "plato"];
let gods=("zeus", "apolo", "hera", "poseidon");
if (humansName === humanName) {
console.log (humanName + " " + "is of man");
} else {
console.log( gods + " " + "is not of man");
}
}
testMortality("zeus");
does this meet the criteria? or am I way off. more over is there a hint I could have to make this better? -
Oof, at least you have CS at the Moment.
My teacher decided to become a father and Take a month Off. -
@cloudsxvx
The instructions say, it should also validate that the name supplied in the argument is a string, and return true or false.
Move the console logs outside of the function and use them to test the true or false result.
This is a fairly dumb setup for a question, imo. Syllogism is closer to set theory in practice than raw Boolean logic.
this is kinda fun I guess
random