CSC 1100 Lecture Notes - Lecture 4: String Literal, Ieee Floating Point

18 views4 pages
1 of 4
CSC 1100 Problem Solving and Programming
Session 4 Notes 17 January 2019
Administrative
Todays session
Chapter 2 (continued)
Variables
Data types
String and character literals
Variable declarations
Reserved words
Session Topics
Variables
A variable is a named spot in memory used to hold a value.
A variable has at least three characteristics:
Name
Data type
Value
A variable name:
Begins with a letter or underscore.
Is followed by zero or more letters, digits, and underscores.
Data types
● Every variable has a data type. This is so that humans and the computer know
how to handle and interpret it.
● Every programming language provides a set of data types.
● See C++ language specification on Canvas for the list of data types.
● A variable of data type char, short, int, long, or long long stores an integer.
● A variable of data type float, double, or long double stores a real number.
● See Data types sample application on Canvas.
Integer data types
Each integer data type has a capacity: a minimum and maximum possible value.
● While an application is running, if the minimum possible value is exceeded (an
underflow) or the maximum possible value is exceeded (an overflow), the variable
value wraps around.
find more resources at oneclass.com
find more resources at oneclass.com
Unlock document

This preview shows page 1 of the document.
Unlock all 4 pages and 3 million more documents.

Already have an account? Log in

Document Summary

Is followed by zero or more letters, digits, and underscores. A variable is a named spot in memory used to hold a value. A variable has at least three characteristics: This is so that humans and the computer know how to handle and interpret it. Every programming language provides a set of data types. See c++ language specification on canvas for the list of data types. A variable of data type char, short, int, long, or long long stores an integer. A variable of data type float, double, or long double stores a real number. See data types sample application on canvas. Each integer data type has a capacity: a minimum and maximum possible value. While an application is running, if the minimum possible value is exceeded (an underflow) or the maximum possible value is exceeded (an overflow), the variable value wraps around. 32,768 (min) i = i + 1 s = s 1.

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