Stcc Prog-116 C# 2010 Chapters 1 - 4 Study Quiz

Reviewed by Editorial Team
The ProProfs editorial team is comprised of experienced subject matter experts. They've collectively created over 10,000 quizzes and lessons, serving over 100 million users. Our team includes in-house content moderators and subject matter experts, as well as a global network of rigorously trained contributors. All adhere to our comprehensive editorial guidelines, ensuring the delivery of high-quality content.
Learn about Our Editorial Process
| By Sylvia
S
Sylvia
Community Contributor
Quizzes Created: 1 | Total Attempts: 259
| Attempts: 259 | Questions: 90
Please wait...
Question 1 / 90
0 %
0/100
Score 0/100
1. Name one of  the two prefixes that should be used for the int data type

Explanation

The correct answer is "int, i" because "int" is the actual prefix used for the int data type in programming languages like Java, C++, and C#. Additionally, "i" is a commonly used variable name for integers, although it is not technically a prefix.

Submit
Please wait...
About This Quiz
Stcc Prog-116 C# 2010 Chapters 1 - 4 Study Quiz - Quiz

This quiz combines all of the Chapter Questions and Knowledge Check Questions from Chapters 1-4.

2. Name one of  the two prefixes that should be used for the char data type

Explanation

The correct answer is "chr" and "c". These are the two prefixes that should be used for the char data type. The "chr" prefix is commonly used to indicate a character, while the "c" prefix is a shorter alternative. Both prefixes are valid and can be used interchangeably when declaring variables of the char data type.

Submit
3. Name one of  the two prefixes that should be used for the String data type

Explanation

The correct answer is "str" and "s" because these are two common prefixes that are used to represent the String data type in programming languages. The prefix "str" is often used to indicate a variable or object that stores a string value, while the prefix "s" is a shorter alternative that is also commonly used. These prefixes help to distinguish String variables from variables of other data types and make the code more readable and understandable.

Submit
4. Name one of  the two prefixes that should be used for the byte data type

Explanation

The correct answer is "byte". In Java, "byte" is a primitive data type used to store whole numbers from -128 to 127. It occupies 8 bits of memory. "by" and "byt" are not valid prefixes for the byte data type.

Submit
5. Name one of  the two prefixes that should be used for the double data type

Explanation

The correct answer is "dbl, d". These are the two prefixes that should be used for the double data type. The prefix "dbl" is a commonly used abbreviation for "double", while the prefix "d" is also accepted and understood by programmers as a shorthand for "double". Both prefixes indicate that the variable or constant is of the double data type, which is used to store decimal numbers with a larger range and precision compared to other numeric data types.

Submit
6. Name one of  the two prefixes that should be used for the float data type

Explanation

The correct answer is "flt, f". These are the two prefixes that should be used for the float data type. The prefix "flt" is a commonly used abbreviation for "float", while the prefix "f" is a shorthand notation that is also widely accepted and used in programming languages. Both prefixes indicate that a variable or constant is of the float data type, which represents decimal numbers with a fractional component.

Submit
7. What is the (industry standard) prefix that should be used for the following Object: Textboxes

Explanation

The industry standard prefix for the given object "Textboxes" is "txt". This prefix is commonly used to indicate that the object is a textbox. It helps in maintaining consistency and clarity in naming conventions within the industry.

Submit
8. What is the (industry standard) prefix that should be used for the following Object: Labels

Explanation

The industry standard prefix "lbl" should be used for the given object "Labels". This prefix is commonly used to indicate that the object is a label. It helps to maintain consistency and clarity in the code, making it easier for developers to understand and work with the object.

Submit
9. 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

Explanation

When you run a form after designing it using the Form Designer but without adding any code to it, the buttons on the form will not trigger any specific actions or events. However, the rest of the form will still function as intended. This means that the form will be displayed and any other elements or functionality that were designed in the Form Designer will still be present and usable. The buttons, in this case, will not have any associated code to execute, so clicking on them will not cause any specific actions to occur. Therefore, the statement "the buttons don't cause anything to happen, but otherwise the form works" is true.

Submit
10. Name one of  the two prefixes that should be used for the bool data type

Explanation

also acceptable are boo and bool, but bln and b are more commonly used.

Submit
11. What is the (industry standard) prefix that should be used for the following Object: Forms

Explanation

The industry standard prefix "frm" should be used for the object "Forms". This prefix is commonly used to indicate that the object is a form, which is a graphical user interface component used to collect and organize data. By using this prefix, it helps to clearly identify and differentiate the object as a form within the context of the industry standard naming conventions.

Submit
12. Examine the first two lines of code and then compare it to the third line of code.  Do they accomplish the same thing? int iCount; iCount = 10; int iCount = 10;

Explanation

The first two lines of code declare a variable called iCount and assign the value 10 to it. The third line of code combines the declaration and assignment into a single line. Both sets of code accomplish the same thing, which is initializing the variable iCount with the value 10. Therefore, the answer is yes, they accomplish the same thing.

Submit
13. A variable stores a value that can be change as the program executes.

Explanation

A variable is a container that holds a value, and this value can be changed as the program runs. In programming, variables are used to store and manipulate data. By assigning different values to a variable throughout the program, we can update and modify the data as needed. Therefore, the statement that a variable stores a value that can be changed as the program executes is true.

Submit
14. The following code calls the Focus method of the txtMonthlyInvestment control: txtMonthlyInvestment.Focus();

Explanation

This code snippet calls the Focus method of the txtMonthlyInvestment control, indicating that the control will receive the focus or become the active element on the page. Therefore, the correct answer is True.

Submit
15. The C# char data type supports the two-byte Unicode character set, which can store practically store any character from any language in the world.

Explanation

The C# char data type is capable of storing the two-byte Unicode character set, which means it can accommodate characters from any language in the world. This makes the statement true.

Submit
16. DateTimedateNumber9 = Convert.ToDateTime("06/08/98 17:30"); String sOutput = dateNumber9.ToString("d"); What is the value of sOutput?

Explanation

The value of sOutput is "6/8/1998". This is because the Convert.ToDateTime() method is used to convert the given string "06/08/98 17:30" to a DateTime object. Then, the ToString() method is used with the "d" format specifier, which represents the short date pattern. This pattern displays the date in the format "M/d/yyyy", resulting in the value "6/8/1998" for sOutput.

Submit
17. Is this a valid statement in C# (will it compile and work): int iAge = 0, iCount = 10;

Explanation

This statement is valid in C#. It declares two integer variables, iAge and iCount, and initializes them with the values 0 and 10 respectively. This code will compile and work without any issues.

Submit
18.  float fNumber1 = 12.3f;  String sOutput = fNumber1.ToString("n3"); What is the value of sOutput?

Explanation

The value of sOutput is "12.300". The code is converting the float variable fNumber1 to a string using the ToString method with the format "n3", which specifies that the number should be displayed with 3 decimal places.

Submit
19. Decimal decNumber3 = 1234567.1m; String sOutput = decNumber3.ToString("c0"); What is the value of sOutput?

Explanation

The value of sOutput is formatted as a currency with no decimal places. It displays the number 1234567 as $1,234,567.

Submit
20. Name one of  the two prefixes that should be used for the long data type

Explanation

The correct answer is "lng" or "l". These are the two prefixes that should be used for the long data type. The "lng" prefix is commonly used to indicate a long integer data type, while the "l" prefix is used in some programming languages to denote a long data type. Both prefixes are used to differentiate the long data type from other data types, such as integers or floating-point numbers.

Submit
21. Float fNumber4 = 123456.0f; String sOutput = fNumber4.ToString("f1"); What is the value of sOutput?

Explanation

The value of sOutput is "123456.0" because the ToString("f1") method formats the float value fNumber4 with one decimal place.

Submit
22. Float fNumber2 = 12.348f; String sOutput = fNumber2.ToString("n1"); What is the value of sOutput?

Explanation

The value of sOutput is 12.3 because the ToString("n1") method formats the float value to have one decimal place. Therefore, the float value 12.348 is rounded to 12.3.

Submit
23. DateTimedateNumber10 = Convert.ToDateTime("06/08/98 17:30"); String sOutput = dateNumber10.ToString("t"); What is the value of sOutput?

Explanation

The value of sOutput is "5:30 PM" because the Convert.ToDateTime() method is used to convert the string "06/08/98 17:30" into a DateTime object. Then, the ToString("t") method is called on the DateTime object to convert it into a string representation of the time in the current culture's short time format, which is "5:30 PM".

Submit
24.  Name one of  the two prefixes that should be used for the short data type  

Explanation

One of the two prefixes that should be used for the short data type is "sht". The "sht" prefix is commonly used to indicate a variable or data type that stores short integer values. It is a standard naming convention in programming languages to use prefixes to provide clarity and indicate the type or purpose of a variable. The "sht" prefix helps programmers easily identify and differentiate short integer variables from other data types.

Submit
25. A user entry that can't be converted to a number is a common cause of a runtime error

Explanation

When a user enters a value that cannot be converted to a number (e.g., entering letters instead of digits), it can cause a runtime error. This is because the program expects a numeric input but receives an incompatible data type. The program may not be able to handle this unexpected input, leading to a runtime error. Therefore, it is true that a user entry that cannot be converted to a number is a common cause of a runtime error.

Submit
26. Float fNumber5 = 123456.0f; String sOutput = fNumber5.ToString("n0"); What is the value of sOutput?

Explanation

The value of sOutput is 123,456. This is because the ToString("n0") method is used to format the float number fNumber5 as a string with zero decimal places and using thousands separators.

Submit
27. Float fNumber6 = .234f; String sOutput = fNumber6.ToString("p2"); What is the value of sOutput?

Explanation

The value of sOutput is "23.40%". The given code converts the float variable fNumber6 into a string representation using the format "p2", which means it will be displayed as a percentage with two decimal places. Therefore, the resulting string will be "23.40%".

Submit
28. Which of the following is a valid comment?

Explanation

The correct answer is "// This is a comment" because in programming languages like C++, Java, and JavaScript, the double forward slash "//" is used to indicate a single-line comment. This means that anything written after the "//" will be ignored by the compiler or interpreter, making it a valid comment. The other options are not valid comments because they either lack the required syntax or do not follow the conventions of the programming language.

Submit
29. A constant stores data

Explanation

A constant stores data that does not change as a program executes. This means that the value assigned to a constant remains the same throughout the execution of the program and cannot be modified. Constants are typically used to store fixed values or values that should not be altered during the program's execution.

Submit
30. To change the file name for a form, project, or solution you use the

Explanation

To change the file name for a form, project, or solution, the correct tool to use is the Solution Explorer. The Solution Explorer provides a hierarchical view of the files and folders in a project or solution. It allows you to easily navigate through the project structure and make changes to file names, add or remove files, and organize the project.

Submit
31. To improve the readability of your C# code, it's recommended that you use all capital letters for variable names.

Explanation

Using all capital letters for variable names is not recommended for improving the readability of C# code. It is a common convention to use camel case for variable names in C#, where the first letter of each word is capitalized except for the first word. This convention helps to make the code more readable and understandable for other developers. Using all capital letters can make the code harder to read and understand, as it may be perceived as shouting or emphasizing the variable name.

Submit
32. What type of control is used to provide for user entry?

Explanation

A textbox is used to provide for user entry. It allows the user to input text or data into a form or application. Unlike a label, which only displays text, a textbox allows the user to interact with it by typing or editing text. Listbox and button controls do not directly provide for user entry, as a listbox displays a list of options for selection and a button triggers an action. Therefore, a textbox is the correct control for user entry.

Submit
33. Int i = 4; int j = 8; int k = 17; Given the above variables, what is the value of x after the following statement is executed? int x = i + j;

Explanation

The value of x after the statement "int x = i + j;" is executed is 12. This is because the variables i and j are assigned the values 4 and 8 respectively. The addition operation "i + j" evaluates to 12, which is then assigned to the variable x.

Submit
34. What is the name of the Visual Studio window that contains controls that you can drag on to a form?

Explanation

The Toolbox window in Visual Studio contains controls that can be dragged onto a form. These controls are pre-built components that can be used to add functionality and interactivity to the form. The Toolbox provides a convenient way to access and add these controls to the design surface of the form, making it easier for developers to build the user interface of their application.

Submit
35. The CancelButton property of a form sets the button that will be activated if the user presses the _________________ key

Explanation

The CancelButton property of a form sets the button that will be activated if the user presses the Esc key. This means that when the user is interacting with the form and presses the Esc key, the action associated with the CancelButton will be triggered. This is useful in situations where the user wants to cancel or close the form without submitting any changes or performing any further actions.

Submit
36. To override the order of precedence in an arithmetic expression, you can use:

Explanation

Parentheses are used in an arithmetic expression to specify the order in which operations should be performed. When parentheses are used, the operations within them are evaluated first, overriding the default order of precedence. This allows for more control and flexibility in performing calculations.

Submit
37. What is this an example of? int TaxRate = (int)2.5d;

Explanation

The given code is an example of explicit casting. The variable "TaxRate" is being assigned the value of 2.5d, which is a double data type. However, the variable is declared as an integer (int). In order to assign a double value to an integer variable, explicit casting is required. The "(int)" before 2.5d indicates the explicit casting of the double value to an integer value.

Submit
38. When assigning a value to a string data type you must enclose the value in what:

Explanation

When assigning a value to a string data type, the value must be enclosed in double quotes (""). Double quotes are used to indicate that the characters within them should be treated as a string. This is a common convention in many programming languages. Parentheses, braces, and single quotes are not used to enclose string values. Parentheses are used for grouping expressions, braces are used for defining blocks of code or data structures, and single quotes are used for enclosing character literals.

Submit
39. Decimal decNumber7 = -1234567.871m; String sOutput = decNumber7.ToString("c2"); What is the value of sOutput?

Explanation

The value of sOutput is ($1,234,567.87) because the ToString("c2") method is used to format the decimal number as a currency value with two decimal places. The negative sign is included in the formatted output.

Submit
40. Int i = 4; int j = 8; int k = 17; Given the above variables, what is the value of x after the following statement is executed? int x = j / i;

Explanation

The value of x after the statement is executed is 2. This is because the division operator (/) performs integer division, which discards any decimal places. Therefore, when j (8) is divided by i (4), the result is 2.

Submit
41. To concatenate two or more strings into one, you use this character:

Explanation

To concatenate two or more strings into one, you use the "+" character. The "+" operator is used to combine or join strings together, resulting in a new string that contains the combined values of the original strings. For example, if you have two strings "Hello" and "World", using the "+" operator like "Hello" + "World" would result in the concatenated string "HelloWorld".

Submit
42. Is this a valid statement in C# (will it compile and work): string sName = 'Brian Candido';

Explanation

The given statement is not valid in C#. In C#, single quotes ('') are used to represent characters, not strings. To represent a string, double quotes ("") should be used. Therefore, to make the statement valid, the string should be enclosed in double quotes like this: string sName = "Brian Candido";

Submit
43. Decimal a = 2.5m; decimal b = 4.0m; decimal c = 12.7m; Given the above variables, what is the value of x after the following statement is executed? decimal x = a + b;

Explanation

When the statement "decimal x = a + b;" is executed, the values of variables a and b are added together. Since a is 2.5 and b is 4.0, the sum of these two values is 6.5. Therefore, the value of x after the statement is executed is 6.5.

Submit
44. Int i = 4; int j = 8; int k = 17; Given the above variables, what is the value of x after the following statement is executed? double x = Math.Pow(i, 2);

Explanation

The value of x after executing the statement is 16. The Math.Pow() function is used to calculate the power of a number. In this case, it calculates the square of the variable i, which has a value of 4. So, 4 raised to the power of 2 is equal to 16, which is the value assigned to x.

Submit
45. IDE stands for what?

Explanation

An IDE is a software application that provides comprehensive tools and features for software development. It integrates various tools, such as code editors, compilers, debuggers, and build automation tools, into a single platform, making it easier for developers to write, test, and debug code. Therefore, the correct answer is Integrated Development Environment.

Submit
46. If you want to write C# code you would use what?:

Explanation

The code editor is the correct answer because it is the tool used for writing C# code. It provides features such as syntax highlighting, code completion, and debugging capabilities, making it easier for developers to write and edit their code. The solutions explorer, forms designer, and console designer are other tools in the development environment that serve different purposes but are not specifically used for writing code in C#.

Submit
47. Which of the following is a valid decimal literal?

Explanation

The letter "m" in the decimal literal "30.0m" represents the suffix for a decimal data type in some programming languages, such as C#. This suffix is used to indicate that the number should be treated as a decimal value. Therefore, "30.0m" is a valid decimal literal.

Submit
48. Which values can a boolean data type contain (pick all that apply):

Explanation

A boolean data type can only contain two values, which are True and False. It cannot contain characters or numbers.

Submit
49. Int i = 4; int j = 8; int k = 17; Given the above variables, what is the value of x after the following statement is executed? int x = k % j;

Explanation

The statement "int x = k % j;" calculates the remainder when k is divided by j. In this case, k is 17 and j is 8. When 17 is divided by 8, the remainder is 1. Therefore, the value of x after executing this statement is 1.

Submit
50. Decimal a = 2.5m; decimal b = 4.0m; decimal c = 12.7m; Given the above variables, what is the value of x after the following statement is executed? decimal x = Math.Round(c)

Explanation

The Math.Round() method is used to round a decimal number to the nearest whole number. In this case, the variable c has a value of 12.7. When Math.Round(c) is executed, it will round 12.7 to the nearest whole number, which is 13. Therefore, the value of x after the statement is executed will be 13.

Submit
51. Assuming total is a decimal variable, which of the following statements does not convert it to a string?

Explanation

The correct answer is "string s = String.Parse(total)". This statement does not convert the variable "total" to a string. The String.Parse() method is used to convert a string representation of a number to its numeric equivalent, not the other way around. In this case, since "total" is already a decimal variable, there is no need to convert it to a string.

Submit
52. To create an access key that will move the focus to a text box, you

Explanation

Setting the access key in the Text property of the label immediately before the text box allows the user to use the access key to move the focus directly to the text box. This means that when the user presses the access key, the focus will be automatically placed in the text box, allowing them to start typing without having to manually click on the text box.

Submit
53. What is the term for a method that responds to events?

Explanation

An event handler is the term used to describe a method that responds to events. This method is responsible for executing a specific set of instructions when a particular event occurs. It is commonly used in programming to handle user interactions, such as button clicks or keystrokes, and perform the necessary actions in response to those events.

Submit
54. What data type should be used to store currency data?

Explanation

The data type "decimal" should be used to store currency data because it provides the most accurate representation of decimal numbers, including precise handling of decimal places. Unlike "double" and "float" which are floating-point types and can introduce rounding errors, "decimal" is a fixed-point type that ensures accurate calculations and avoids loss of precision. Additionally, "int" is not suitable for storing currency data as it only supports whole numbers and does not allow for decimal places.

Submit
55. Int i = 4; int j = 8; int k = 17; Given the above variables, what is the value of x after the following statement is executed? int x = k % j;

Explanation

The value of x after the statement "int x = k % j;" is executed is 1. The modulus operator (%) returns the remainder when the first operand (k) is divided by the second operand (j). In this case, k (17) divided by j (8) equals 2 with a remainder of 1. Therefore, the value of x is 1.

Submit
56. What are the values of x and y after the following statements are executed? char cLetter1 = 'A'; char cLetter2 = ++cLetter1;

Explanation

The variable cLetter1 is assigned the value 'A'. Then, the prefix increment operator is used to increment the value of cLetter1 by 1, resulting in the value 'B'. This incremented value is then assigned to cLetter2. Therefore, the value of cLetter1 is 'B' and the value of cLetter2 is also 'B'.

Submit
57. CLR stands for what?:

Explanation

CLR stands for Common Language Runtime. It is a component of the .NET framework that provides an environment for executing managed code. Managed code is written in high-level languages like C# or VB.NET and is compiled into Intermediate Language (IL) code. CLR is responsible for managing memory, handling exceptions, performing garbage collection, and providing other services that are necessary for running managed code. It also provides a common runtime environment for different programming languages to interoperate seamlessly.

Submit
58. If you want to create a C# Form you would use what?:

Explanation

To create a C# Form, you would use the Form Designer. This tool allows developers to visually design the user interface of a Windows Form application. It provides a drag-and-drop interface for adding controls, setting properties, and arranging the layout of the form. The Form Designer simplifies the process of creating a user-friendly and visually appealing form by providing a graphical interface for designing the form's layout and appearance.

Submit
59. The primary components of the .NET Framework are the .NET Framework Class Library and the

Explanation

The correct answer is the Common Language Runtime. The Common Language Runtime (CLR) is a key component of the .NET Framework that provides an execution environment for applications. It manages memory, handles exceptions, and performs other essential tasks to ensure the smooth execution of .NET programs. The .NET Framework Class Library is also an important component, but it is not the primary component as stated in the question. The other options, Command Language Runtime, Windows Forms classes, and ASP.NET classes, are not the primary components of the .NET Framework.

Submit
60. The Text property of a control determines

Explanation

The Text property of a control determines the text that is displayed in the control. This means that when the control is rendered on the screen, the value of the Text property will be shown to the user. It is used to provide information or instructions to the user, or to display dynamic content that can be updated programmatically.

Submit
61. When an application encounters a problem that prevents a statement from being executed,

Explanation

When an application encounters a problem that prevents a statement from being executed, a runtime error occurs. This means that there is an error in the code that is causing the application to stop running or crash. Runtime errors can be caused by a variety of factors, such as invalid input, memory issues, or logic errors in the code. These errors often need to be debugged and fixed in order for the application to run correctly.

Submit
62. A syntax error is identified in

Explanation

A syntax error is identified in the Code Editor window and the Error List window. The Code Editor window is where the code is written and edited, so any syntax errors will be highlighted and displayed here. The Error List window, on the other hand, provides a list of all the errors in the code, including syntax errors. Therefore, both windows are used to identify syntax errors in the code.

Submit
63. Is this a valid statement in C# (will it compile and work): char sLetter = "C";

Explanation

The given statement is not valid in C#. In C#, a char variable can only store a single character enclosed in single quotes. The double quotes used in the statement indicate a string, not a character. To assign a character to the variable, it should be enclosed in single quotes like 'C'.

Submit
64. If a decimal variable named total has a value of 1234.56, what string will result from the following statement? string s = total.ToString("c2")

Explanation

The statement total.ToString("c2") converts the decimal variable total into a string representation using the currency format with 2 decimal places. In this format, the number is displayed with a dollar sign ($) and commas as thousand separators. Therefore, the resulting string will be "$1,234.56".

Submit
65. Access keys let the user activate a control by

Explanation

Access keys allow the user to activate a control by pressing the Alt key along with another key. This combination of keys provides a shortcut for accessing specific controls or functionalities within a software application or website. By pressing the Alt key, the user can navigate through menus, buttons, or other interactive elements by using the corresponding access key assigned to them. This helps improve accessibility and efficiency for users who prefer to navigate using keyboard shortcuts rather than mouse clicks.

Submit
66. Int i = 4; int j = 8; int k = 17; Given the above variables, what is the value of x after the following statement is executed? int x = i / j;

Explanation

The value of x after the statement "int x = i / j;" is executed is 0. This is because the division of the integer i (4) by the integer j (8) results in a quotient of 0. Since both i and j are integers, the division operation performs integer division, which discards any decimal remainder and only returns the whole number quotient. Therefore, the value of x is 0.

Submit
67. Which statement is equivalent to the following statement? total = total + tax;

Explanation

The statement "total += tax;" is equivalent to "total = total + tax;". It is a shorthand notation for adding the value of "tax" to the current value of "total" and assigning the result back to "total".

Submit
68. How could you rewrite the following sequence of statements as a single statement, assuming the temp1 variable is not required after these statements are executed? decimal temp1 = 1.0 - discountPct; total = total * temp1;

Explanation

The given sequence of statements can be rewritten as a single statement "total = total * (1.0 - discountPct)". This statement multiplies the value of "total" by the result of subtracting "discountPct" from 1.0. By enclosing the expression "1.0 - discountPct" in parentheses, it ensures that the subtraction operation is performed before the multiplication operation. This single statement achieves the same result as the original sequence of statements and eliminates the need for the "temp1" variable.

Submit
69. The label control has a TabStop property.

Explanation

The statement is false because the label control does not have a TabStop property. The TabStop property is used to determine whether a control can receive focus when the user presses the Tab key. Since a label control is typically used for displaying text and does not require user interaction, it does not have a TabStop property.

Submit
70. Two properties that are common to both forms and controls are the

Explanation

Both forms and controls have the properties of "Name" and "Text". The "Name" property allows the user to assign a unique identifier to the form or control, which can be used for referencing and manipulating it in the code. The "Text" property, on the other hand, allows the user to set the display text for the form or control, which is what the user sees on the screen. These properties are common to both forms and controls, allowing for consistency and ease of use in programming and designing user interfaces.

Submit
71. When assigning a value to a char data type you must enclose the value in what:

Explanation

The correct answer is '' single quotes because when assigning a value to a char data type, the value must be enclosed within single quotes. Single quotes indicate that the value is a character literal. Using any other type of quotation marks or brackets would result in a syntax error.

Submit
72. Int i = 4; int j = 8; int k = 17; Given the above variables, what is the value of x after the following statements are executed? int x = 27; x -= i;

Explanation

The value of x after the statements are executed is 23. This is because the statement "x -= i;" subtracts the value of i (which is 4) from the current value of x (which is 27), resulting in a new value of 23.

Submit
73. What is the purpose of the .NET Framework Class Library?

Explanation

The purpose of the .NET Framework Class Library is to provide pre-written code that can be used by .NET applications. This allows developers to save time and effort by utilizing existing code for common functionalities, such as file manipulation, database connectivity, and user interface components. By using the pre-written code from the Class Library, developers can focus on the specific requirements of their applications rather than reinventing the wheel.

Submit
74. To refer to a property of an object in your C# code, you code the

Explanation

In C#, to refer to a property of an object, you code the object name followed by a period and the property name. This syntax is used to access the members (properties and methods) of an object. By using the period, you can directly access the specific property of the object and perform operations on it.

Submit
75. To change the name of all instances of a variable name after you change the first instance, you can use? Select the most efficient answer.

Explanation

Refactoring is the most efficient answer because it refers to the process of restructuring and improving code without changing its external behavior. By using refactoring techniques, you can easily change the name of a variable throughout your codebase, ensuring consistency and avoiding errors. This approach allows for efficient and reliable updates to variable names, enhancing code readability and maintainability.

Submit
76. What is another name for a runtime error?

Explanation

A runtime error is commonly referred to as an exception. It is an error that occurs during the execution of a program, typically due to unexpected circumstances or invalid operations. Exceptions are used to handle and manage errors in a program, allowing for graceful handling of unexpected situations and preventing the program from crashing. Therefore, exception is another name for a runtime error.

Submit
77. Before a C# application can be run, it must be compiled into a language called:

Explanation

Before a C# application can be run, it must be compiled into a language called Microsoft Intermediate Language (MSIL). MSIL is a low-level, platform-independent language that is generated by the C# compiler. It is not directly executable by the computer, but it can be further compiled into machine code by the Just-In-Time (JIT) compiler when the application is run. This allows the C# code to be executed on different platforms and architectures without needing to recompile it for each specific environment.

Submit
78. What data types could be used to store the value of 3.14? (Pick all that apply):

Explanation

The value of 3.14 can be stored in the data types float, double, and decimal. These data types are capable of storing decimal values with varying levels of precision. Float and double are used to store floating-point numbers, with double having a higher precision than float. Decimal is used to store decimal numbers with higher precision than float and double. Int and long are integer data types and cannot store decimal values, so they are not applicable in this case.

Submit
79. Why won't the following statement compile? int TaxRate = 0.05d;

Explanation

The statement won't compile because the variable "TaxRate" is declared as an integer (int), but the value assigned to it is a double (0.05d). In C#, you cannot implicitly convert a double to an int without explicitly casting it.

Submit
80. Int i = 4; int j = 8; int k = 17; Given the above variables, what is the value of x after the following statement is executed? decimal x = i / j;

Explanation

The value of x after the statement is executed is 0.0. This is because both i and j are integers, so when they are divided, the result is also an integer. In this case, 4 divided by 8 equals 0. Since x is declared as a decimal, the result is converted to a decimal value of 0.0.

Submit
81. Float fNumber8 = -.2345f; String sOutput = fNumber8.ToString("p1"); What is the value of sOutput?

Explanation

The value of sOutput is -23.5% or -23.5 %. The given code converts the float variable fNumber8 to a string representation using the "p1" format specifier. The "p1" format specifier is used to display a floating-point number as a percentage with one decimal place. Therefore, the float value of -.2345 is converted to -23.5% or -23.5 % in string format.

Submit
82. Visual Studio 2010 supports these programming languages.  Choose all valid editions:

Explanation

Visual Studio 2010 supports multiple programming languages including Visual Basic, Visual C#, Visual C++, and Visual F#. These languages are valid editions in Visual Studio 2010. Visual J+ is not a valid edition in Visual Studio 2010.

Submit
83. The .NET Framework Class Library consists of

Explanation

The correct answer is "classes that are organized into namespaces." The .NET Framework Class Library is a collection of reusable classes, interfaces, and value types that are organized into namespaces. Namespaces are used to organize and group related classes together, providing a way to avoid naming conflicts and make the code more organized and manageable. Classes within the .NET Framework Class Library are grouped into these namespaces, making it easier for developers to locate and use the desired functionality when building .NET applications.

Submit
84. What data type should be used to store the value of 3.14 for the sake of efficiency?

Explanation

The data type "float" should be used to store the value of 3.14 for the sake of efficiency. Float is a data type that can store decimal numbers with a smaller range and precision compared to double or decimal. Since 3.14 is a relatively small decimal number and does not require high precision, using float would be more efficient in terms of memory usage and computational speed.

Submit
85. Int i = 4; int j = 8; int k = 17; Given the above variables, what is the value of x after the following statement is executed? int x = k / (j - i);

Explanation

The value of x is 4 because the statement calculates the value of k divided by the difference between j and i. In this case, j is 8 and i is 4, so the difference is 4. Therefore, k divided by 4 equals 4.

Submit
86. Choose the data types that can store numbers that have decimal places (pick the best choices all that apply):

Explanation

The data types float, double, and decimal can store numbers that have decimal places. Float is a single-precision floating-point type that can store decimal numbers with a smaller range and precision. Double is a double-precision floating-point type that can store decimal numbers with a larger range and precision. Decimal is a high-precision decimal type that can store decimal numbers with the highest precision and a smaller range compared to float and double.

Submit
87. Visual Studio 2010 comes in various editions with different features. Choose all valid editions:

Explanation

Visual Studio 2010 comes in various editions with different features. The Express Edition is a valid edition of Visual Studio 2010, which is a free version with limited features. The Professional Edition is also a valid edition, which includes advanced features for professional developers. The Premium Edition is another valid edition, which offers additional features such as database development and testing tools. The Ultimate Edition is the highest-tier edition, which includes all features and tools available in Visual Studio 2010. Therefore, all four editions mentioned in the answer - Express, Professional, Premium, and Ultimate - are valid editions of Visual Studio 2010.

Submit
88. Choose the data types that can store integers (pick all that apply):

Explanation

The data types that can store integers are byte, sbyte, short, ushort, int, uint, long, and ulong. These data types are specifically designed to store whole numbers without decimal places. Float, double, and decimal are data types used to store floating-point numbers with decimal places. Char is used to store single characters, and bool is used to store boolean values (true or false).

Submit
89. The value -26500 could be stored in what data types (pick all that apply):

Explanation

Since the number is negative you don't want to put it into any unsigned integer data types. You could put the value into short, int and long data types. In this example the best choice would be short to efficiently store the value without wasting storage.

Submit
90. The whole number 127 can be stored in what data types (pick all that apply):

Explanation

The whole number 127 can be stored in data types that have a range large enough to accommodate it. These data types include byte, sbyte, short, ushort, int, uint, long, and ulong. These data types can store whole numbers within their respective ranges, and the value 127 falls within the range of each of these data types.

Submit
View My Results

Quiz Review Timeline (Updated): Mar 21, 2023 +

Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.

  • Current Version
  • Mar 21, 2023
    Quiz Edited by
    ProProfs Editorial Team
  • Oct 13, 2011
    Quiz Created by
    Sylvia
Cancel
  • All
    All (90)
  • Unanswered
    Unanswered ()
  • Answered
    Answered ()
Name one of  the two prefixes that should be used for the int...
Name one of  the two prefixes that should be used for the char...
Name one of  the two prefixes that should be used for the String...
Name one of  the two prefixes that should be used for the byte...
Name one of  the two prefixes that should be used for the double...
Name one of  the two prefixes that should be used for the float...
What is the (industry standard) prefix that should be used for the...
What is the (industry standard) prefix that should be used for the...
When you run a form after you've used the Form Designer to design it...
Name one of  the two prefixes that should be used for the bool...
What is the (industry standard) prefix that should be used for the...
Examine the first two lines of code and then compare it to the third...
A variable stores a value that can be change as the program executes.
The following code calls the Focus method of the txtMonthlyInvestment...
The C# char data type supports the two-byte Unicode character set,...
DateTimedateNumber9 = Convert.ToDateTime("06/08/98 17:30");...
Is this a valid statement in C# (will it compile and work):...
 float fNumber1 = 12.3f;...
Decimal decNumber3 = 1234567.1m;...
Name one of  the two prefixes that should be used for the long...
Float fNumber4 = 123456.0f;...
Float fNumber2 = 12.348f;...
DateTimedateNumber10 = Convert.ToDateTime("06/08/98 17:30");...
 Name one of  the two prefixes that should be used for the...
A user entry that can't be converted to a number is a common cause...
Float fNumber5 = 123456.0f;...
Float fNumber6 = .234f;...
Which of the following is a valid comment?
A constant stores data
To change the file name for a form, project, or solution you use the
To improve the readability of your C# code, it's recommended that...
What type of control is used to provide for user entry?
Int i = 4;...
What is the name of the Visual Studio window that contains controls...
The CancelButton property of a form sets the button that will be...
To override the order of precedence in an arithmetic expression, you...
What is this an example of? int TaxRate = (int)2.5d;
When assigning a value to a string data type you must enclose the...
Decimal decNumber7 = -1234567.871m;...
Int i = 4;...
To concatenate two or more strings into one, you use this character:
Is this a valid statement in C# (will it compile and work):...
Decimal a = 2.5m;...
Int i = 4;...
IDE stands for what?
If you want to write C# code you would use what?:
Which of the following is a valid decimal literal?
Which values can a boolean data type contain (pick all that apply):
Int i = 4;...
Decimal a = 2.5m;...
Assuming total is a decimal variable, which of the following...
To create an access key that will move the focus to a text box, you
What is the term for a method that responds to events?
What data type should be used to store currency data?
Int i = 4;...
What are the values of x and y after the following statements are...
CLR stands for what?:
If you want to create a C# Form you would use what?:
The primary components of the .NET Framework are the .NET Framework...
The Text property of a control determines
When an application encounters a problem that prevents a statement...
A syntax error is identified in
Is this a valid statement in C# (will it compile and work):...
If a decimal variable named total has a value of 1234.56, what string...
Access keys let the user activate a control by
Int i = 4;...
Which statement is equivalent to the following statement?...
How could you rewrite the following sequence of statements as a single...
The label control has a TabStop property.
Two properties that are common to both forms and controls are the
When assigning a value to a char data type you must enclose the value...
Int i = 4;...
What is the purpose of the .NET Framework Class Library?
To refer to a property of an object in your C# code, you code the
To change the name of all instances of a variable name after you...
What is another name for a runtime error?
Before a C# application can be run, it must be compiled into a...
What data types could be used to store the value of 3.14? (Pick all...
Why won't the following statement compile? int TaxRate = 0.05d;
Int i = 4;...
Float fNumber8 = -.2345f;...
Visual Studio 2010 supports these programming languages.  Choose...
The .NET Framework Class Library consists of
What data type should be used to store the value of 3.14 for the sake...
Int i = 4;...
Choose the data types that can store numbers that have decimal places...
Visual Studio 2010 comes in various editions with different features....
Choose the data types that can store integers (pick all that apply):
The value -26500 could be stored in what data types (pick all that...
The whole number 127 can be stored in what data types (pick all that...
Alert!

Advertisement