Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

If

329 views

Published on

Published in: Education, Lifestyle, Business
  • Be the first to comment

  • Be the first to like this

If

  1. 1. IF
  2. 2. IF is All Around Us EverydayIF it is cold out THEN you will put a coat onELSE leave the coat at homeIF you do your homestudy THEN no detentionELSE you get a detention
  3. 3. IF Is Like A Test With An EffectThe test: Is it cold? The Effect if the test is True: Put your coat on IF it is cold out THEN you will put a coat on ELSE leave the coat at home The Effect if the test is False: Leave coat at home
  4. 4. The Structure of IF in VBIf <TEST> Then<CODE IF THE TEST IS TRUE>Else :<CODE IF THE TEST IS FALSE>End If
  5. 5. Are You Old Enough To Drink?Module Module1 Sub Main() Dim age As Integer = 14 If age > 16 Then Console.WriteLine("old enough") Console.ReadLine() Else : Console.WriteLine("Your not old enough!!") Console.ReadLine() End If End SubEnd Module
  6. 6. Are You Old Enough To Drink? – With User InputModule Module1 Sub Main() Dim age As Integer Console.WriteLine("ENTER YOUR AGE") age = Console.ReadLine() If age > 16 Then Console.WriteLine("old enough") Console.ReadLine() Else : Console.WriteLine("Your not old enough!!") Console.ReadLine() End If End SubEnd Module

×