Write a correct variable declaration for a decimal value named price.
double price;
What data type is used for storing long decimal numbers?
double
What symbol ends most C# statements?
;
What is the output? int x = 3; outputLabel.Text = x.ToString();
3
What is one method of outputting information to the user is by this "pop-up" box.
MessageBox
What is wrong with this line?
string first name = "Alex";
Variable names cannot have a space.
What keyword is used to declare a variable with a whole number?
int
True or False: Every opening brace must have a closing brace at some point later in the program.
True
What is the value of total? int a = 4; int b = 6; int total = a + b;
10
What is the output? MessageBox.Show("Hello" + " World");
Hello World
True or False: Variables must be declared before they are used in C#
True
What data type would best store multiple characters?
String
How is a string denoted in code?
""
What is the output? int x = 10; x = x + 2; outputLabel.Text = x.ToString();
12
What is the output? string name = "Ava"; MessageBox.Show("Hello " + name);
Hello Ava
Declare and initialize a variable named age with the value 17.
int age = 17;
What data type is used with money?
decimal
What is the correct syntax for a Message Box?
MessageBox.Show("text");
What is the output? int x = 2; int y = x * x + 3; outputLabel.Text = y.ToString();
7
What is the output? string number = "3"; MessageBox.Show(number + "2");
32
What term is used to describe where a variable can be referenced in code?
Scope
Which type uses more memory: int or double ?
double
List the organizational tree in C# from most broad to least.
Namespace -> Class -> Method
What is the output? int x = 13; int y = 3; int z = x % y; outputLabel.Text = z.ToString();
1
What method is called to convert a string to a numerical data type?
Parse()