changes a value to a data type that might not be able to hold some of the

# Changes a value to a data type that might not be able

This preview shows page 6 - 8 out of 8 pages.

changes a value to a data type that might not be able to hold some of the possible values for example, a fractional value is rounded when it is converted to an integral type, and a numeric type being converted to Boolean is reduced to either True or False for eg. 11- Specify runtime errors in the following statements a- Dim intCount As Integer = 123 b- Dim intAge As Integer = 4 c- Dim datBirth As Date = CDate("11/30/2011") d- Dim dblPayroll As Double = CDbl("123") e- Total= FirstNum +SecondNum 12- Differentiate between Explicit and Strict options in VB.net. State the default value for each option. Explicit The Explicit option indicates whether you will declare all variables. Strict The Strict option indicates whether all variables will be of a specific type 13- What is wrong with each of the following? a. shoTotal = shoNum1 + shoNum2 b. Dim decPrice As Decimal = " \$4.99 " c. shoCube = (shoSide) *3 14- What is the value of x after each statement is performed? a. x = 7 + 3 * 3 \ 2 – 1 x= 7 + 9 \ 2 - 1 x = 7 + 1- 1 x = 7+1 - 1 x = 8-1
CC215 VB .NET (LAB 3) x=7 b. x = 2 Mod 2 + 2 * 2 - 2 / 2 x = 2 Mod 2 + 4 - 2 / 2 x = 2 Mod 2 + 4 - 1 x = 0 + 4 - 1 x = 4 - 1 x = 3 c. x = (3 * 9 * (3 + (9 * 3 / (3)))) x=27*(3+ (9*3/ (3))) x=81+ (9*3/ (3)) x=81+27/3 x=81+9 x=90 d. x = 6 * 2 ^ 3 + 4 / 2 x= 6*8+4/2 x=48+4/2 x=48+2 x=50 e. x = 6 / 2 * 2 ^ 3 + 4 x=6/2*8+4 x=6/16+4 x= 15- Given z = 8e 5 -n write in VB expression. 8*e^5-n 16- Complete the following table Number value Format string toString() value 12.3 N3 12.000 12.348 n2 12.00 1234567.1 n 1234567 123456.0 f2 123456.00 123456.0 e3 12345e+005 .234 p 0.00% –1234567.8 c \$1,234,568.00
CC215 VB .NET (LAB 3)

#### You've reached the end of your free preview.

Want to read all 8 pages?

• Winter '20
• .NET Framework, Microsoft Visual Studio
Stuck? We have tutors online 24/7 who can help you get unstuck.
Ask Expert Tutors You can ask You can ask You can ask (will expire )
Answers in as fast as 15 minutes