This is for programming using visual basic on visual studio.
Write code to:
a) Place the contents of txtQuantity into intQuantity. You should
be able to determine what types of objects they are based upon
their names.
b) Using the objects, what value would be placed into intQuantity if the value of txtQuantity is 3.5?
Solution(a)
The object is of Integer type
' declare intQuantity as Integer type
Dim intQuantity As Integer
' get the value from txtQuantity and assign it
' to intQunatity after convert value into Integer
intQuantity = Integer.Parse(txtQuantity.Text)
Solution (b)
Since the intQuantity of an Integer type So it will not take a fractional part of the value.
If you assign it to 3.5, It will take only 3. So the value of intQunatity is 3.
'If you need any help regarding this solution..... please leave a comment... thanks
Get Answers For Free
Most questions answered within 1 hours.