If the number of decimal places is omitted in a Format function (ex. Format Curr
ID: 3792765 • Letter: I
Question
If the number of decimal places is omitted in a Format function (ex. Format Currency a 23.4567). 6. the number of how many decimal places will display? 0 1 2 As many as there are significant digits in the value Which format string sets up 3 columns of width 12, 15 characters. The first zone has right with alignment, the second zone is left alignment with Currency and the third zone uses right alignment numbers in decimal places. fmtStr = "{1, 10} {2.-12; C_2} {3.15: NI}" fmtStr = "{0, -10} {1, 12:C} {2, -15:NI}" fmtStr = "{0, 10} {1, -12:C} {2, 15:NI" fmtStr = "{0, 10} {1, -12:Format Currency} {2, 15:FormatNumber(1)}" A form has a subroutine named btn Compute_Click and a subroutine named btn Summary Click Each will be using the same counting variable named counter. How should counter be declared? Variable counter should be declared once in btn Compute_Click. Variable counter should be declared at the top of the form outside of either subroutine. It does not matter where counter is declared as long as it is done somewhere in the form code. Variable counter should be declared twice, once in btn Compute Click and once in btn Summary Click. Assume total is a class-level Double variable. Which line of code could be used to read in a sales figure and add it to total? Private Sub btnCompute Click (... Dim s As Double s = CDbl (txtSale. Text) total = total + 1 End Sub Private Sub btnCompute_Click (..... Dim s As Double s = CDbl (txtSale.Txt) total = s + s End Sub Private Sub btnComoute_Click (.. Dim s As Double s = CDbl (txtSale. Text) total = total + s End sub Private Sub btnComupte_Click (.. Dim s As Double Dim total As Double = 0.0 s = CDbl (txtSale.Text) total = total + s End Sub Which statement is not true about a class-level variable? It is created once when the form is loaded. All code in all subroutines of the form may access it. It is declared within the class but not within any subroutine. It is created each time a subroutine is entered and is destroyed each time the subroutine ends.Explanation / Answer
6. It displays upto two decimal places. Answer is 6(c)
decimal moneyvalue = 123.123m;
string html = String.Format("Order Total: {0:C}", moneyvalue);
Console.WriteLine(html);
Prints 123.12
7 . The answer is B
8. (b) Variable counter should be delared at the top of the form outside the subroutine, so that both can access the same variable.
9(c) --> Since Total is a class level variable, we dont have to declare it and
total = total + s, So the answer is (C)
10(d) d is false..It is not destroyed based on the subroutine..So last statement is not true...Answer is (d)