I need help with a group of questions based on Microsofts Visual Basic 2012 8th
ID: 3773459 • Letter: I
Question
I need help with a group of questions based on Microsofts Visual Basic 2012 8th edition.
Chatper 6 knowledge check:
8) Using a compound operator, write an assignment statement to increment the value in intAmount by 7.
9) Using a compound operator, write an assignment statement to decrease the value in intCounter by 4.5.
10) Using a compound operator, write an assignment statement to increment the value in IntQuantity by 10.
11) Write a top-controlled Do Until loop with an empty body that would continue until intValue is greater than 19.
Explanation / Answer
8) Using a compound operator, write an assignment statement to increment the value in intAmount by 7.
Compound assignment statements first perform an operation on an expression before assigning it to a programming element.
So, the solution is: Amount += 7;
This statements first evaluates the expression, Amount+7, and then assigns the result to Amount. This is pretty much equivalent to the equation: Amount = Amount + 7;
9) Using a compound operator, write an assignment statement to decrease the value in intCounter by 4.5.
The solution is: Counter -= 5;
This statement is equivalent to the equation: Counter = Counter - 5;
10) Using a compound operator, write an assignment statement to increment the value in IntQuantity by 10.
Quantity += 10; will increment the Quantity by 10, and will assign the result to Quantity.
11) Write a top-controlled Do Until loop with an empty body that would continue until intValue is greater than 19.
Do
Value += 1 'Increments the Value by 1, which keeps the loop moving.
Loop Until Value > 19
If you have any further queries, just get back to me.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.