



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




CSE 1301
Figures from Lewis, “C# Software Solutions”, Addison Wesley
CSE 1301 (^) 1-
CSE 1301 (^) 1-
CSE 1301 (^) 1-
CSE 1301 (^) 1-
CSE 1301 (^) 1-
CSE 1301 (^) 1-
CSE 1301 (^) 1-
Console.Out.WriteLine (“Whatever you are, be a good one.”);
Output device Monitor Console – class Out - objects
Method name parameter
WriteLine method includes a “new line” character.
CSE 1301 (^) 1-
CSE 1301 (^) 1-
int total; int count, temp, result; Multiple variables can be created in one declaration
data type variable name
CSE 1301 (^) 1-21 CSE 1301 (^) 1-
total = 55;
target = expression;
CSE 1301 (^) 1-
int numPlayers = 10; // numPlayers holds 10 numPlayers = 8; // numPlayers now holds 8
int legalAge = 18; int voterAge = legalAge;
The next statement is illegal int height = weight * 2; // weight is not defined int weight = 20;
CSE 1301 (^) 1-
double twoCents; double twoCents = .02;
CSE 1301 (^) 1-
double cashInHand; int cashInHand;
CSE 1301 (^) 1-
const dataType constantIdentifier = assignedValue;
const double TAX_RATE = .05;
CSE 1301 (^) 1-
CSE 1301 (^) 1-
Type Size Minimum Value Maximum Value in Bytes char 2 character character encoded as 0 encoded as FFFF
Example declarations: char finalGrade = ‘A’; char newline, tab, doubleQuotes;
CSE 1301 (^) 1-
true false
bool isEmpty; bool passed, failed = false ;