CS 1100 Lecture Notes - Lecture 3: Semicolon

12 views3 pages
25 Aug 2016
School
Course
Professor

Document Summary

A variable is a place we can store data. It identifies what type of data can be stored in that variable. Name usually describes what variable is being used for. Before a variable can be used, it must be created. To declare a variable, put datatype & name follow by semicolon. Double: used for holding numbers with decimal places (real numbers) Once a variable is declared, we can put something inside of it. We put something inside of a variable with = Specifically, we say the variable name, =, and whatever we want to put inside, then a semicolon age = 55; cost = 19. 95; In real life, we can multiple things in a box however, in programming, we can only put one thing at a time in a variable. If something is already in a variable and we put something else, the new item will replace the previous item! We can change what"s inside the variable, it can vary.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents