Upgrade to remove ads
Replaced to make text to speech better: .NET -> dot NET Chapters 1 - 7 "Blank" Is the word you should be trying to guess Setting up: 1.) Choose Flashcards 2.) Turn Audio On 3.) Start With: Both Sides 4.) Shuffle and Play On 5.) Have fun...
Terms in this set (192)
The C# blank builds the source code in a C# source file into an executable file.
IDE stands for
Integrated Development Environment
One of the Visual Studio 2010 languages that can be used for rapid application development is C#. Another language that supports rapid application development is
When the code for an application has been translated into intermediate language and is ready to run, it is stored in an
To run the intermediate language for an application, Visual Studio provides the
Common Language Run time
To review the files that are used for an application, you can use the
A Windows Forms application runs
under the Windows operating system
The forms of a Web Forms application are displayed in a
The primary components of the dot NET Framework are the dot NET Framework Class Library and the
Common Language Run time
The dot NET Framework Class Library consists of
classes that are organized into namespaces
What is the purpose of the dot NET Framework Class Library?
it provides pre-written code that can be used by dot NET applications
What is the purpose of the Common Language Run time?
it manages the execution of dot 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
To write the C# code for a form, you use a Visual Studio window called the
To work with the files of a solution, you use a Visual Studio window called the
When you run a Windows Forms project, Visual Studio displays the project's first
To create a new Visual Studio project, you select a blank from the New Project dialog box to specify the type of project you want to create.
The blank property of a text box lets you prevent the user from entering data into the control.
To prevent a control from receiving the focus when the user presses the Tab key, you should set the control's TabStop property to
To customize the way Visual Studio works, you can use the blank command in the Tools menu.
The import and export settings for Visual Studio affect the way the tool bars and blank work.
To provide for a user entry, you use a blank control.
The Cancel Button property of a form sets the button that will be activated if the user presses the blank key.
The title that's displayed in the title bar of a form is determined by the blank property for the form.
To set the properties for two or more controls at the same time, you need to first blank the controls.
To change the size of a control or form, you can blank one of its sizing handles.
What is the name of the Visual Studio window that contains controls that you can drag on to a form?
Two properties that are common to both forms and controls are the
Name and Text properties
What form property do you use to activate a button control when the user presses the Enter key?
The tab order determines the order in which
the controls on a form receive focus when the user presses the Tab key
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.
Which of the following statements is true?
The Label control doesn't have a Tab Stop property.
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 invoice, with the letter n as the access key?
Invoice with an ampersand before the n
To change the file name for a form, project, or solution you use the
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
An operation that an object can perform is called a
The process of creating an instance of a class is called
The properties, methods, and events of a class are called the blank of the class.
When used to separate method or property names from class or object names, the period is called the blank operator.
When you use the Form Designer to create a new form, Visual Studio generates C# code that creates a new class based on the blank class.
When you move or size a control in the Form Designer, Visual Studio automatically adjusts the blank that specify the location and size of the control.
To insert the starting code for an if statement into the code for a form, you can use a
When you change the name of a variable in your C# code, Visual Studio will ask whether you want to change all of the other uses of that name through a feature known as
Write the code for a comment that should read "currency format"
forward slash forward slash currency format
Write a statement that sets the Read Only property of a control named t x t Date to true. (txtDate)
txtDate.ReadOnly = true;
t x t Date dot Read Only equals true semicolon
Write a statement that calls the Focus method of a control named t x t Last Name (txtLastName)
t x t Last Name dot Focus Parenthesis semicolon.
Write a statement that calls the Close method of the current form.
this dot Close parenthesis semicolon
A class is
the code that defines the characteristics of an object
An object is
an instance of a class
Instantiation is the process of generating
an object from a class
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? t x t Monthly Investment dot Focus parenthesis semicolon. (txtMonthlyInvestment)
calls the Focus method of the t x t Monthly Investment control (txtMonthlyInvestment)
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?
What event does Visual Studio generate code for when you double-click a button in the Form Designer?
What is the name of the method generated when you double-click a button named b t n Process in the Form Designer? (btnProcess)
b t n Process underscore Click
Blocks of code are enclosed in
C# statements must end with a
A syntax error is identified in
the Code Editor window and the Error List window
You can get context-sensitive help information from the Code Editor by
positioning the insertion point in a keyword and pressing F 1
When an application encounters a problem that prevents a statement from being executed,
a run time error occurs
When you test an application, your goal is to
find run time errors
What is another name for a run time error?
A data tip
displays the value of a variable or property
Once common cause of a run time error is
a user entry that can't be converted to a number
To change the name of all instances of a variable name after you change the first instance, you can use
Values that change during the execution of a program are usually stored in
The values operated on by operators in an expression are called
In the order of precedence for arithmetic expressions, addition and subtraction are done before or after multiplication and division.
Converting data from a less precise data type to a more precise data type is referred to as blank conversion.
When you need to convert a value from a more precise data type to a less precise data type you use an blank cast.
When you use the methods of the Math class, you don't create an object from the class. Instead, you use the blank methods of the class.
The type of rounding that causes a number that's midway between two whole numbers to always be rounded to the even number is called blank rounding.
Each value data type is defined by a
Each reference data type is defined by a
To convert the data in any built-in data type to another data type, you can use the methods of the static blank class.
To convert a decimal variable's data to a string, you can use the blank method of the variable.
A variable declared outside of any method has blank scope.
A variable declared within a method has blank scope.
In the statement that follows, the value 123.45 is called a? total equals 123.45 semicolon
By default, you can assign a null value to a variable that's a reference type. But to assign a null value to a variable that's a value type, you need to declare the variable as a
Write a statement that declares a variable named count as an integer type with a starting value of zero.
int count equals 0 semicolon
Write a statement that declares a variable named sales Total as a decimal type with a starting value of 205,000.
decimal salesTotal = 205000m;
decimal sales total equals 205000 m semicolon
Write a statement that declares a variable named is Valid as a Boolean type with a starting value of false, and do that in the shortest way.
bool is valid
Use the equals operator to write a statement that adds 1 to the value stored in a variable named count and assigns the result to the count variable.
count = count + 1;
count equals count plus one semicolon
Use a shortcut operator to write a statement that adds 1 to the value stored in a variable named count and assigns the result to the count variable.
count += 1;
count plus equals one semicolon
Write an arithmetic expression that calculates the yearly interest earned on a amount that's stored in a decimal variable named principal Amount at an interest rate that's stored in a decimal variable named interest Rate. (The interest rate is stored as a decimal fraction like .055 for a rate of 5.5%.)
principalAmount * interestRate
principal Amount times interest rate
Write an arithmetic expression that calculates the percent increase (or decrease) of the sales for the current year by using the values that are stored in two variables named last Y T D Sales and this Y T D Sales. (thisYTDSales, lastYTDSales)
(thisYTDSales - lastYTDSales)/lastYTDSales * 100
Left parenthesis this Y T D Sales minus last Y T D Sales Right parenthesis divided by last Y T D Sales times 100
Given two decimal variables named a and b, write a statement that assigns the smaller of the two to a new decimal variable named c.
decimal c = Math.Min(a,b);
decimal c equals Math dot Min left parenthesis a comma b right parenthesis semicolon
Given double variables a and b that contain the lengths of the two short sides of a right triangle, write a statement that uses the methods of the Math class to calculate the length of the third side. Save the result in a new double variable named c. The formula is:
double c = Math.Sqrt((Math.Pow(a,2)+Math.Pow(b,2));
double c equals Math dot S Q R T left parenthesis left parenthesis Math dot Pow left parenthesis A comma 2 right parenthesis plus Math dot Pow left parenthesis B comma 2 right parenthesis right parenthesis semicolon
Write a statement that declares a string variable named city And State and assigns a starting value of Cleveland.
string cityAndState = "cleveleand";
string city and state equals left quote cleveland right quote semicolon
Write a statement that appends a comma, a space, and the value that's stored in a string variable named state to the variable named city And State.
string cityAndState += ", " + state;
string city and state plus equals left quote comma space right quote plus state semicolon
The bool data type stores a
true or false value
Which built-in data type is the most precise type for storing monetary values?
Which built-in data type stores only whole numbers?
A constant stores data
that does not change as a program executes
Which of the following is a valid decimal literal?
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.
Why won't the following statement compile? int Tax Rate equals 0.05 d semicolon
the value shouldn't be followed by a letter.
override the order of precedence in an arithmetic expression, you can use
To assign a more precise numeric data type to a less precise numeric data type, you can code
an explicit cast
If you declare a variable within a method, the variable will be available
only within that method
Which of the following data types can't be used for storing the number 123.4567? Double, Float, Int, or Decimal
A structure is
a value type
An enumeration defines a set of related
To code a Boolean expression, you use blank operators.
To combine two or more Boolean expressions into a single expression, you use blank operators.
An if statement that's coded within another if statement is called a blank if statement.
A variable that's declared within the braces of an if or else clause in an if-else statement is said to have blank scope.
To implement the selection structure, you use an blank statement.
To implement the case structure, you use a blank statement.
To implement the iteration structure, you can use a for, while, or blank statement.
The benefit of using a for loop instead of a while loop is that you can declare and increment a blank in the for statement.
A loop that continues indefinitely is called/an blank loop.
To enter break mode as an application is executing, you can set a
In break mode, the window that displays the values of the variables in the scope of the current method is called the blank window.
Code a Boolean expression that tests if a decimal variable named sales This Y T D is equal to zero.
salesThisYTD == 0
sales This Y T D equals equals zero
Code a Boolean expression that tests if a decimal variable named current Sales is greater than or equal to 1000 or a Boolean Variable named new Customer is equal to true. Code this statement so that both conditions will always be tested, and code it in the shortest way possible.
current Sales greater than equals one thousand vertical line new Customer
Code a Boolean expression that tests if a Boolean variable named inactive is not equal to true and a decimal variable named net Sales is greater than or equal to 0. Code this statement so that the second condition is tested only if the first condition is true, and code it in the shortest way possible.
exclamation inactive ampersand ampersand net Sales greater than zero
If you use a short-circuit logical operator to combine two expressions
the second expression is evaluated only if it can affect the result
Unlike an if-else statement, a switch statement
can't perform an operation based on the result of a boolean expression
What must you do if you code an infinite loop in an application?
Cancel the application to end the loop
If you code a break statement in a loop, it will cause the application
to jump out of the loop.
If you code a continue statement in a loop, it will cause the application
to jump to the beginning of the loop
When you set a breakpoint at a statement and run the application, the application enters break mode
just before that statement is executed
When you're in break mode, you can
press F 11 to step through the program one statement at a time.
The first expression that's coded within the parentheses in a for loop
assigns a starting value to a counter variable.
In a do while loop, the Boolean expression is tested
after the loop is executed
In a while loop, the Boolean expression is tested
before the loop is executed
What statement is used to implement the selection structure?
What statement is used to implement the case structure?
What statement is used to implement the iteration structure?
If you want to code a method that can only be called from the class that the method is in, you code blank as the access modifier in the method declaration.
If a method returns a value and its parameters are passed by value, the code within the method must include a blank statement.
When you call a method, you must include the blank required by the method.
An object that's used to connect an event to an event handler is known as a
When a call statement passes a variable as an argument to a method by reference, the called method can change the value of the variable in the balnk method
To generate a call statement and a method from existing code, you can use a feature called
To delete a method from a class, you not only have to delete the method but also its
The blank for a method determines whether or not the method can be called by other classes.
The process of connecting an event of an object to an event handler is called blank the event.
Code a statement that calls a method in the current form named Set Buttons that accepts a Boolean value, but does not return a value. Pass the value "false" to this method, and use the this keyword to indicate whether the method can be found.
this dot set buttons left parenthesis false right parenthesis semicolon
Code a statement that calls a method named Calculate Sales Tax, adds the result of this method to a variable named subtotal, and stores the result in a variable named total. Assume that the Calculate Sales Tax method accepts the subtotal as a parameter, and use the this keyword to indicate where the method can be found.
total = subtotal + this.CalculateSalesTax(subtotal);
total equals subtotal plus this dot Calculate Sales Tax left parenthesis subtotal right parenthesis semicolon
Code the declaration for a private method named Get Message that returns a string value and requires one decimal parameter named current Balance.
private string GetMessage(decimal currentBalance);
private string Get Message Left Parenthesis decimal current balance right parenthesis semicolon
Code the declaration for a private method named Get Message that returns a string value and requires a string parameter named full Name and a decimal parameter named current Balance in that order.
private string GetMessage(string fullName, decimal currentBalance);
private string Get Message left parenthesis string full name comma decimal current balance right parenthesis semicolon
What keyword do you code at the beginning of a method that's only available within the current class?
What keyword do you code for the return type of a method that doesn't return any data?
For each parameter in the parameter list for a method, you must code
the data type of the parameter followed by the name of the parameter
When you call a method with a parameter list, the arguments in the argument list
must be declared with data types that are compatible with the parameters
The signature of a method is formed by the
name of the method and its parameter list
If you pass a variable by reference, the called method
can change the value of the variable in the calling method
If you pass a variable by value, the called method
can't change the value of the variable in the calling method
If you declare a parameter for a method as optional,
the parameter must be assigned a constant value as its default
You don't have to know the name of the associated parameter
To generate an event handler for a control event, you can display the Events list for the control and then
double click on the event
Once you display the list of events for a control, you can wire an existing event handler to any event by
selecting the event handler from the drop downlist for the event
When an error occurs during the execution of a method, the method blank an exception.
The process of checking user entries to make sure they're valid is called
The process of checking a value to be sure that it's not less than a minimum value and not greater than a maximum value is called
The list of methods that were called before an exception occurred is called the
All exceptions are derived from the dot Net blank class.
The process of preventing exceptions from causing runtime errors is called
To get a description of an exception that has been caught, you can use the exception's blank property.
To code statements that should be executed whether or not any exceptions are caught by a try-catch statement, you can use a blank block.
If a value that's assigned to an int variable is too large to be stored in it, a blank exception occurs.
To test the catch blocks in a try-catch statement, you can code blank statements.
To test whether a text box entry has a valid decimal format, you need to use a blank statement.
If a text box entry can't be converted to a numeric data type, a blank exception occurs.
One way to code a method that calls generic methods to test the validity for all of the user entries of a form is to code one blank statement for each method call and return a false value if the generic method returns a false value.
To get the type of an exception, you can use the exception's Get Type
To display a dialog box, you can use the Show method of
the MessageBox class
In a try-catch statement, a catch block for the Exception class can be used to catch
any exceptions that aren't caught by previous catch blocks
Two properties of an object created from the Exception class are
Message and Stack Trace
In a try-catch statement, the finally block is executed
whether or not an exception occurs or a catch block is executed
What statement causes a new exception to occur?
You typically do not throw an exception
when invalid data is detected
When validating data entered into the text boxes of a form, it is not common to check whether
all text entries are non numeric
An OverflowException can be avoided by a type of data validation known as
You may want to code generic methods for data validation because
they allow you to reuse your data validation code
In C#, exceptions are
To determine the cause of an exception, you can
all of the above
The code within a catch block is executed when
a method in the try block throws an exception
When a statement within a try block causes an exception, the remaining statements in the try block
You should validate user entries rather than catch and handle exceptions caused by invalid entries whenever possible because
your code will run faster
You might also like...
CPT230 test 3
EXAM #2 Programming
IS 315 Exam 1
Other Quizlet sets
GIS exam 2 all
3A1X1 Block 4 Unit 4
Textbook Chapter 2 quiz