Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

The features we use or add to our applications in Visual Studio are arranged by

ID: 3821316 • Letter: T

Question

The features we use or add to our applications in Visual Studio are arranged by Namespaces in the .Net framework. A. True B. False Look at this code. How long will my variables remain in RAM? private: System::Void btnAdd_Click(System::Object^sender, System::EventArgs^e) {String^itemSelected = 1stItems rightarrow Text rightarrow Substring (0, 15) rightarrow Trim(); double price = Convert::ToDouble (1stItems rightarrow Text rightarrow Substring(16) rightarrow Trim());} A. Until the application exits. B. Until the computer is turned off. C. Until the code in the event handler is finished. D. Until someone dicks the button. Look at # 12 again. Both variables are called____variables. A. logical B. simple C. value type D. reference type E. local Look at #12 again. What is "Convert::ToDouble" used for? A. It converts a double to a string B. It converts a substring to a regular string C. It is casting a string to a double D. None of the above Which statement is equivalent to the following statement? total = total + tax; a. total = tax++; b. total += tax; c. total = -tax++; d. total ==+ tax; If a double precision variable named 'total' has a value of 705.56, what string from the following statement? string s = total.ToString("c') a. $705.56 b. 705.56 c. 705 d. 706

Explanation / Answer

11. The features we use or add to our applications in Visual Studio are arranged by Namespaces in the .Net framework

Answer: A. True

In .Net all the classes are organized by Namespaces. Simply we can say a Namespace is a set of classes that are used to implement a particular feature.

For example if we want our program to write something to the console we use System.Console.Write(“sometext”), here System is a Namespace which contains a class Console which provide a feature of writing text to console

12. Look at this code. How long will my variables remain in RAM?

Private System::Void btnAdd_Click(System::Object sender, System::EventArgs a)

{

                String itemSelected = lstItems->Text->Substring(0,15)->Trim();

                double price = Convert::ToDouble(lstItems->Text->Substring(16)->Trim())

}

Answer: C. Until the code in the event handler is finished.

The above is a method that handles button click event. The memory is allocated for variables in RAM when the Event handler start its execution, and the variables remain in the RAM until the execution of the code in the Event handler is completed.

13. Look at #12 again. Both variable are called ___________ variables.

Answer: E. Local

Variable that are declared within a function are called local variables and there scope is within the function, other functions will not be able to see or access these variables.

14. Look at #12 again, what is “Convert::ToDouble” used for?

Answer: C. It is casting a string to a double

The Convert::ToDouble method convert a string to double.

15. Which statement is equivalent to the following statement?

Total = total + tax;

Answer: b. total += tax;

+= is called an Addition assignment operator, the above statement means that tax is added to total and the result is assigned to total

16. If a double precision variable named ‘total’ has a value of 705.56, what string will be printed from the following statement

String s = total.ToString(“c”)

Answer: a. $705.56

The ToString() is used convert a numeric value into a string, when ToString (“c”) , the numeric value is represented as a currency value, the default currency symbol is $ so the above statement displays $705.56

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote