Showing posts with label if. Show all posts
Showing posts with label if. Show all posts

Friday, February 8, 2013

Excercise between W1 and W3

Week-3: 3.1: IF statement

The programming you're doing now is sequential programming, meaning the code is
executed from top to bottom. It's very linear, in that each and every line of code will be
read, starting with the first line of code you write and ending at the last line.

But you don't always want your programmes to work like that. Often, you want code to
be executed only if certain conditions are met. For example, you might want one message
to display if a user is below the age of 18 and a different message if he or she is 18 or
older. You want to control the flow of the programme for yourself. You can do this with
conditional logic.

Conditional logic is mainly about the IF word: IF user is less than 18 then display this
message; IF user is 18 or older then display that message. Fortunately, it's very easy to
use conditional logic in Java. Let's start with IF Statements.

Visit for Details