1 / 18

Variables

Variables. Mr. McTavish. One address – one piece of information. Boolean – True/False. How to Declare. bool blBoolean ; – or – Boolean blBoolean2 ; Boolean is the preferred type. How to Initialize. blBoolean = true ; – or – blBoolean2 = false ;. Integer. How to Declare.

rehan
Download Presentation

Variables

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Variables Mr. McTavish

  2. One address – one piece of information

  3. Boolean – True/False

  4. How to Declare boolblBoolean; – or – Boolean blBoolean2; Boolean is the preferred type.

  5. How to Initialize blBoolean = true; – or – blBoolean2 = false;

  6. Integer

  7. How to Declare intintInteger; – or – Int32 intInteger2; Int32 is the preferred type

  8. How to Initialize intInteger = -7; – or – intInteger2 = 3764;

  9. Floating Point

  10. How to Declare doubledblDouble; – or – Double dblDouble2; Double is the preferred type

  11. How to Initialize dblDouble = 3.01; – or – dblDouble2 = 1;

  12. Output //Declare and initialize DoubledblPrice = 3.1; //Outputs as dollar Console.WriteLine(dblPrice.ToString("$0.00"));

  13. Char

  14. How to Declare charchrChar; – or – Char chrChar2; Note: Char is the preferred type

  15. How to Initialize chrChar = 'a'; – or – chrChar2 = 'Z'; Note the single quotation marks

  16. String

  17. How to Declare stringstrString; – or – String strString2; Note: String is the preferred type

  18. How to Initialize strString = "Hello"; – or – strString2 = "A String";

More Related