2.2: Boolean Challenges
Last updated
Last updated
In this module we'll provide a few challenges for learning about and studying Booleans:
Right click on the solution you made in the first module
Go to Add > New Project and select Console App (.NET Framework)
Name it 0.02_Booleans_Challenges
Write your code for this module within Program.cs
of that project
In addition to printing true if the value is less than 10, create another boolean expression that prints a message if value is greater than or equal 10.
using the variable: string password = "LetMeIn1234!";
, check if the password is equal to LetMeIn1234!
. If it is, send a message to the user that they are able to get in. If the password is wrong, send a message that something went wrong.
Create a conditional that prompts the user to enter a number from 1-5 to indicate how they're feeling. Print a string to the console based on the number that the user enters. For instance, if a user enters a 5, you might print a response that says something like this: "Great to hear that you're feeling so good!"
Answer to Challenges
Conditionals