Flex your knowledge of relational operators, Boolean expressions, and the if-else statement in this challenge exercise.
(upbeat music) - Hi folks, it's time for another challenge. And guess what? We're going to create a guessing game. Using your knowledge of relational operators, Boolean expressions and the powerful if else statement, I want you to create program, with the following requirements. First it asks the user, what's my favorite food? If the user enters the name of your favorite food, output, Yep! So amazing! If the user doesn't enter the name of your favorite food, output, Yuck! That's not it! Regardless of what the user enters, output, Thanks for playing! You may find it helpful to plan your program on a sheet of paper first. Think about what functions you'll need to call and what variables you'll need to create. This will make it easier for you when you start to write your code in the IDE. Keep in mind there's no single one way to do this. Just have fun and try your best. But make sure you watch the solution video, where I'll share how I tackled the problem.
- Writing source code
- Basic statements and expressions
- Working with numbers and strings
- Writing conditional code
- Increasing your efficiency with functions
- Working with comments
- Making decisions in code
- Troubleshooting errors
- Learning about other languages
Skill Level Beginner
Programming Foundations: Fuzzy Logicwith Erin Colvin41m 50s Intermediate
Programming Foundations: Algorithmswith Joe Marini1h 45m Beginner
Programming Foundations: Design Patternswith Elisabeth Robson1h 44m Intermediate
1. Programming Basics
2. Programming Syntax
3. Variables and Data Types
4. Conditional Code
5. Modular Code
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.