Difference between revisions of "Values, Types, and Variables Identification assignment"

From WLCS
(Created page with "'''Directions:''' * Identify next to each of the numbered items below whether or not it is a value or a variable ** If the item is a value, then identify its type (int, string, f...")
 
 
(10 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
'''Directions:'''
 
'''Directions:'''
 +
<!--
 +
# Open a text editor
 +
-->
 +
# Open up a new document in Google Docs
 +
# Put your name at the top
 +
# Put your Period # under your name
 +
# Title the file as '''Values, Types, and Variables'''
 +
# Complete the exercises below in this file
 +
# Be sure to number each of your answers!!
 +
# Submit your assignment via [http://classroom.google.com Google Classroom]
 +
 +
'''Value Exercises:'''
 
* Identify next to each of the numbered items below whether or not it is a value or a variable
 
* Identify next to each of the numbered items below whether or not it is a value or a variable
 
** If the item is a value, then identify its type (int, string, float)
 
** If the item is a value, then identify its type (int, string, float)
 +
* Examples:
 +
** 5 = value (int)
 +
** x = variable
  
 
# 3
 
# 3
Line 14: Line 29:
 
# 1.0
 
# 1.0
  
* Identify next to each of the variable names whether or not it is a valid variable name
+
'''Variable Naming Rules:'''
 +
# Can only be comprised of letters (a-z,A-Z), numbers (0-9), and underscore (_)
 +
# Cannot start with a number
 +
# Cannot be a reserved word in the language
 +
# No spaces
 +
 
 +
'''Variable Naming Exercises:'''
 +
* Identify next to each of the variable names whether or not the name is VALID or INVALID
  
 
# x
 
# x
Line 26: Line 48:
 
# bobobobob
 
# bobobobob
 
# 429
 
# 429
 +
 +
'''Submit:'''
 +
* Submit your assignment via [http://classroom.google.com Google Classroom]

Latest revision as of 09:23, 12 September 2014

Directions:

  1. Open up a new document in Google Docs
  2. Put your name at the top
  3. Put your Period # under your name
  4. Title the file as Values, Types, and Variables
  5. Complete the exercises below in this file
  6. Be sure to number each of your answers!!
  7. Submit your assignment via Google Classroom

Value Exercises:

  • Identify next to each of the numbered items below whether or not it is a value or a variable
    • If the item is a value, then identify its type (int, string, float)
  • Examples:
    • 5 = value (int)
    • x = variable
  1. 3
  2. hello
  3. "bob"
  4. 8
  5. "9"
  6. 2.5
  7. generals
  8. 1337
  9. "l33t"
  10. 1.0

Variable Naming Rules:

  1. Can only be comprised of letters (a-z,A-Z), numbers (0-9), and underscore (_)
  2. Cannot start with a number
  3. Cannot be a reserved word in the language
  4. No spaces

Variable Naming Exercises:

  • Identify next to each of the variable names whether or not the name is VALID or INVALID
  1. x
  2. xyz
  3. 2x
  4. x!
  5. x2
  6. this_is_a_long_variable_name
  7. hello world
  8. washington-lee
  9. bobobobob
  10. 429

Submit: