Codecademy C# Flashcards
Command to print text to a console
Console.WriteLine(“”)
Command to read text a user types into the console
Console.ReadLine()
Command to run interactive code
dotnet run
One line comments
after //
Multi-line comments
between /* and */
Whole integer number data type
int
A piece of text data type
string
Data type which represents the logical idea of true or false
bool
Decimal number data types
double
Single characters data type
char
Assign variable command
data type __________ = “__________”;
Assign variable example
string countryName = “Netherlands”
Good practice style for naming variables
camelCase
camelCase example
string iAmAVariable
Implicit conversion definition
Happens automatically if no data will be lost in the conversion
Explicit conversion definition
Requires a cast operator to convert a data type into another one
Explicit method for converting to string
Convert.ToString()
Explicit method for converting to double
Convert.ToDouble()
Character after decimal to show that it’s a decimal
m
Character after decimal to show that it’s a decimal example
decimal variableName = 489872.76m
Command to increment by one
++
Command to decrease by one
- -
Modulo definition
Returns a remainder
Modulo operator
%
Command too find the absolute value of a number
Math.Abs()
Command to find the square root of a number
Math.Sqrt()
Command to round a given double or decimal down to the nearest whole number
Math.Floor()
Command to return the smaller of two numbers
Math.Min()
Not a number abbreviation
NaN