A desktop application runs
On the user's computer
Which of the following is not a platform that you can use to develop Windows desktop applications -WPF -UWP -Windows Forms -ASP.NET Core MVC
ASP.NET Core MVC
Which of the following is not a .NET Programming Language -Visual Basic -JavaScript -C# -F#
Javascript
Which of the following statements is true?
.Net Core is newer than the .NET Framework, but it only runs on Windows
.NET Core is newer than the .NET Framework, and it is cross-platform -.NET Core is older than the .NET Framework, and it only runs on Windows
.NET Core is older than the .NET Framework, but it is cross platform.
.NET Core is newer than the .NET Framework, and it is cross-platform.
The primary components of .NET are its class libraries and its
Common Language Runtime
What is the purpose of the .NET class libraries?
They provide pre-written code that can be used by .NET applications.
What is the purpose of the Common Language Runtime? -It provides pre-written code that can be used by .NET applications. -It specifies the format of compiled .NET applications. -It manages the execution of .NET applications. -It specifies the data types that can be used by .NET applications.
It manages the execution of .NET applications.
Before a C# application can be run, it must be compiled into a language called
Microsoft Intermediate Language
An assembly is
an executable file that includes the MSIL or IL
A solution is
a container that holds projects
Which of the following is a way to open a form in the Form Designer window?
Find the form in the Solution Explorer and double-click on it.
To write the C# code for a form, you use a Visual Studio window called the
Code Editor
To work with the files of a solution, you use a Visual Studio window called the
Solution Explorer
A window that appears at the edge of the Visual Studio IDE is called a/an
docked window
Within Visual Studio, which window can you use to change the version of .NET that a project is targeting?
the Project Properties window
When you run a Windows Forms project, Visual Studio displays the project's first
form
To customize the way Visual Studio works, what command do you select from the Tools menu?
options
In Visual Studio, what command of the Tools menu can you use to change the development settings that affect the way the menus and toolbars work?
Import and Export Settings
To create a new Visual Studio project, what do you select from the New Project dialog box to specify the type of project you want to create?
a template
Which control do you use to allow a user to enter some text?
TextBox
Which property of a text box lets you prevent the user from entering data into the control?
ReadOnly
What is the name of the Visual Studio window that contains controls that you can drag onto a form?
toolbox
Two properties that are common to both forms and controls are the
Name and Text properties
Which key can a user press to activate the button that's set by the CancelButton property of a form?
Esc
What form property do you use to activate a button control when the user presses the Enter key?
AcceptButton property
The tab order determines the order in which
the controls on a form receive focus when the user presses the Tab key
To prevent a control from receiving the focus when the user presses the Tab key, which of the control's properties should you set to false?
TabStop
What property of a form sets the title that's displayed in the form's title bar?
Text
To create an access key that will move the focus to a text box, you
set the access key in the Text property of the label immediately before the text box
Access keys let the user activate a control by
pressing Alt plus another key
What would you set the Text property of a label to if you want the label to appear as shown below, with the letter n as the access key?
I&nvoice number
To change the filename for a form, project, or solution you use the
Solution Explorer
The Text property of a control determines
the text that's displayed in the control
When you run a form after you've used the Form Designer to design it but haven't added any code to it,
the buttons don't cause anything to happen, but otherwise the form works
To select two or more controls, you can
hold down either the Shift or Ctrl key while you click on them
To align two or more controls after you've selected them, you can use
both the Format menu commands and the Layout toolbar buttons
When you align or size a group of selected controls, the changes are made relative to the
primary control
an object is
an instance of a class
a class is
the code that defines the characteristics of an object
Instantiation is the process of generating
an object from a class
An operation that an object can perform is called
method
Which of the following is not defined by a class? methods properties notices events
notices
To refer to a property of an object in your C# code, you code the
object name followed by a period and the property name
What does the following code do? txtMonthlyInvestment.Focus();
calls the Focus() method of the txtMonthlyInvestment control
To say that a C# application is event-driven means that it responds to
user events and other types of events
What is the term for a method that responds to events?
event handler
What event does Visual Studio generate code for when you double-click a button in the Form Designer?
click
What is the name of the method generated if you double-click a button named btnProcess in the Form Designer?
btnProcess_Click
Blocks of code are enclosed in
braces - {}
C# statements must end with a
semicolon ;
A syntax error is identified in
the Code Editor window and the Error List window
Which of the following is not a recommended way to improve the readability of your C# code? Use blank lines before and after groups of related statements. Use all capital letters for variable names. Use indentation to align related elements of code. Use spaces to separate words, values, and operators.
Use all capital letters for variable names.
Which of the following is a valid comment?
\ This is a comment ' This is a comment / This is a comment // This is a comment
// This is a comment
Which of the following statements is true? You can't use C# keywords in a comment. Comments must appear at the beginning of a line. Comments can be inaccurate or out of date. Comments make the program run slower.
Comments can be inaccurate or out of date.
To insert the starting code for an if statement into the code for a form, you can use
a code snippet
To change the name of all occurrences of a variable name after you change the first occurrence, you can use
refactoring
When an application encounters a problem that prevents a statement from being executed,
a runtime error occurs
When you test an application, your goal is to
find runtime errors
What is another name for a runtime error?
exception
a data tip
displays the value of a variable or property
Which of the following choices adds a comment that says "currency format" to the end of the line of code? string amount = total.ToString("c"); ' currency format string amount = total.ToString("c"); -- currency format string amount = total.ToString("c"); # currency format string amount = total.ToString("c"); // currency format
string amount = total.ToString("c"); // currency format
Which of the following statements calls the Close() method of the current form? this.Close(); currentForm.Close(); currentForm.Close(this); currentForm.Call(Close);
this.Close();
Which built-in data type is the most precise type for storing monetary values?
decimal
The bool data type stores a
true or false value
Which built-in data type stores only whole numbers? whole float number int
int
A constant stores data
that does not change as a program executes
Which of the following is a valid decimal literal? 30.0 30.0c 30.0d 30.0m
30.0m
Variables named according to camel notation
capitalize the first letter of every word after the first word
Variables named according to Pascal notation
capitalize the first letter of every word including the first word
Consider the following code: decimal a = 2.5m; decimal b = 4.0m; decimal c = 12.7m;
int i = 4; int j = 8; int k = 17; What is the value of x after the following statement is executed? int x = i + j;
12
Consider the following code: decimal a = 2.5m; decimal b = 4.0m; decimal c = 12.7m;
int i = 4; int j = 8; int k = 17; What is the value of x after the following statement is executed? int x = j / i;
2
Consider the following code: decimal a = 2.5m; decimal b = 4.0m; decimal c = 12.7m;
int i = 4; int j = 8; int k = 17; What is the value of x after the following statement is executed? int x = i / j;
0
Consider the following code: decimal a = 2.5m; decimal b = 4.0m; decimal c = 12.7m;
int i = 4; int j = 8; int k = 17; What is the value of x after the following statement is executed? int x = k % j;
1
Consider the following code: decimal a = 2.5m; decimal b = 4.0m; decimal c = 12.7m;
int i = 4; int j = 8; int k = 17; What is the value of x after the following statement is executed? decimal x = a + b;
6.5
Consider the following code: decimal a = 2.5m; decimal b = 4.0m; decimal c = 12.7m;
int i = 4; int j = 8; int k = 17; What is the value of x after the following statements are executed? int x = 27; x -= i;
23
Consider the following code: decimal a = 2.5m; decimal b = 4.0m; decimal c = 12.7m; int i = 4; int j = 8; int k = 17; What is the value of x after the following statement is executed? int x = k / (j - i);
4
Consider the following code: decimal a = 2.5m; decimal b = 4.0m; decimal c = 12.7m;
int i = 4; int j = 8; int k = 17;
What is the value of x after the following statement is executed? decimal x = i / j;
0.0
Consider the following code: decimal a = 2.5m; decimal b = 4.0m; decimal c = 12.7m;
int i = 4; int j = 8; int k = 17; What is the value of x after the following statement is executed? decimal x = (decimal)i / (decimal)j;
0.5
Consider the following code: decimal a = 2.5m; decimal b = 4.0m; decimal c = 12.7m;
int i = 4; int j = 8; int k = 17;
What is the value of x after the following statement is executed? decimal x = Math.Round(c)
13
Consider the following code: decimal a = 2.5m; decimal b = 4.0m; decimal c = 12.7m;
int i = 4; int j = 8; int k = 17; What is the value of x after the following statement is executed? int x = Math.pow(i, 2);
16
Given double variables a and b that contain the lengths of the two short sides of a right triangle, which of the following statements uses the methods of the Math class to calculate the length of the third side and save it in a double variable named c?The formula for calculating the length of the third side is: c = sqrt x^2 + c^2
double c = Math.Sqrt(Math.Pow(a, 2) + Math.Pow(b, 2));
Given the following Random object named number, which of the following choices gets a random integer from 1 to 10 (including both 1 and 10)? Random number = new Random();
int i = number.Next(10); int i = number.Next(11); int i = number.Next(1,10); int i = number.Next(1,11);
int i = number.Next(1,11);
Given the following Random object named number, which of the following statements returns a double value that is greater than or equal to 0.0 and less than 1.0? Random number = new Random();
double d = number.NextDouble(); double d = number.NextDouble(1.0); double d = number.Generate(); double d = number.Generate(1.0);
double d = number.NextDouble();
Which statement is equivalent to the following statement? total = total + tax;
total += tax;
To override the order of precedence in an arithmetic expression, you can use
parentheses