Chapter II Part I

Chapter II Part I - IT108 Data Types and Operations Chapter...

Info iconThis preview shows pages 1–10. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: IT108 Data Types and Operations Chapter Two George Mason University Flowcharts One of the tools available to plan a solution to a problem They dont have to be pretty just use them as a means to solidify your problem solving process Flowchart Symbols terminal process decision input/output connector Example Design a solution to the following problem: Calculate a students final grade in a class where the midterm and final exams are both worth 100 points, but the midterm comprises 40% of the final grade and the final exam comprises 60% of the final grade. Identifiers A sequence of characters : letters, digits, underscores (_), and dollar signs ($). start with a letter, an underscore (_), or a dollar sign ($). It cannot start with a digit. An identifier cannot be a reserved word. (See Appendix A) An identifier can be of any length. Used for class names (including program name) variables, constants, Variables Areas of memory (a determined number of bytes) Used to store values Given names to refer to 25 age variable name location in RAM value Declaring Variables int x; // Declare x to be an // integer variable; double radius; // Declare radius to // be a double variable; char a; // Declare a to be a // character variable; Using Constants and Variables Variable : named memory location Contents may change at run-time Contents described by data type Constant: value stays fixed after compilation Constants may be assigned symbolic name Example: final int MAX = 100; Constant's literal value may be used directly Example: 100 may be hard-coded into program Using Constants and Variables Data type: specifies data in three ways Kind of item being represented Amount of memory item occupies Operations that may be performed on item Eight primitive (basic) data types : byte, short, int, long, float, double, char, boolean Reference types (classes) are built upon primitives Declaring Variables Syntax Rules...
View Full Document

Page1 / 35

Chapter II Part I - IT108 Data Types and Operations Chapter...

This preview shows document pages 1 - 10. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online