Kathryn helps you build a flowchart UML diagram to model how a program using comparison and conditional operators would work. After modeling the program, she shows you how you can use IF statements to implement these comparisons and boolean expressions.
- [Instructor] Lets add some decision making to our programs…Let's say we wanted to create a program that would print out…baby, kid, teen, or adult, based on an inputted age.…The first step in building this program would be…to map out it's control flow using a UML diagram.…UML stands for Unified Modeling Language,…and helps developers visualize the flow of the program.…This is an example of a UML.…We start by getting the users input, which will be a number.…Then, depending on that number, we'll do a specific action.…
Each block of code is represented by a square,…and each condition that decides what will print…is represented by a triangle.…If the inputted number is between zero and five,…then we'll print out baby,…otherwise we'll check this next condition.…Here, if the number is between six and 11,…we'll print out kid.…If not, we'll go to the next condition.…If the number is between 12 and 17, we'll print out teen.…And if the number is 18 and above, we'll print out adult.…If the number is negative,…meaning it met none of the conditions before,…
- Downloading Java 9 and choosing an IDE
- Understanding Java basics: data types, strings, arrays, and more
- Controlling flow with functions and loops
- Working with inheritance and interfaces
- Learning lambda
Skill Level Beginner
1. Getting Started
2. Java Basics
3. Control Flow
4. Beyond the Basics
- 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.