last class sections 3 4 3 6
Download
Skip this Video
Download Presentation
Last Class (sections 3.4 - 3.6)

Loading in 2 Seconds...

play fullscreen
1 / 7

Last Class (sections 3.4 - 3.6) - PowerPoint PPT Presentation


  • 92 Views
  • Uploaded on

Last Class (sections 3.4 - 3.6). What is a variable? rules for naming variables garbage values strings, chars, boolean rules for naming variables Integer Variables example from book +, -, *. Data Types: Reals. A number that contains a decimal point can begin with a ‘+’ or a ‘-’

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about ' Last Class (sections 3.4 - 3.6)' - samantha-mejia


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.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
last class sections 3 4 3 6
Last Class (sections 3.4 - 3.6)
  • What is a variable?
    • rules for naming variables
    • garbage values
    • strings, chars, boolean
    • rules for naming variables
  • Integer Variables
    • example from book
    • +, -, *
data types reals
Data Types: Reals
  • A number that contains a decimal point
    • can begin with a ‘+’ or a ‘-’
    • must have digits on both sides of the decimal
    • cannot contain
      • commas
      • an embedded blank
      • non-numeric characters
      • a’+’ or a ‘-’ at the end of the value
real operators
Real Operators
  • +, -
  • *, /
  • operator precedence
    • PEMDAS
integer operators
Integer Operators
  • +, -
  • *
  • DIV “integer division”
  • MOD “remainder operator”
  • operator precedence
mixed mode
Mixed mode
  • You can assign an integer value to a real variable. The compiler automatically converts the integer into a real (ie. 5 -> 5.0)
  • You cannot assign a real to an integer.
  • Mixed mode is when both integers and reals are on the right side of an expression (a real variable must be on the left side).
correcting syntax errors
Correcting syntax errors
  • Go over example in book
ad