If you divide an integer by an integer and place the result into a double, is the decimal portion of the division maintained? Explain your answer.
What will be an ideal response?
If you divide an integer by an integer, the result is only the whole number part of the quotient. The decimal portion of the division is never calculated, nor maintained
You might also like to view...
Which of the following does the C++ language not support?
a. classes b. global functions c. automatic garbage collection d. support for object oriented programming e. traditional programming techniques
Suppose you would like your code to perform several tasks: Use a For…Next loop with an InputBox to prompt the user four times for the price of four different T-shirts, then display each shirt price with a 25% discount in the ListBox lstResult. Which of the following code segments correctly performs these tasks?
a. ```Dim intIndex As Integer Dim sngPrice, sngDiscountPrice As Single For intIndex = 1 To 4 sngPrice = CSng(InputBox("Enter price of shirt " & intIndex.ToString)) sngDiscountPrice = sngPrice * 0.75 lstResult.Items.Add(sngDiscountPrice) Next ``` b. ```Dim intIndex As Integer Dim sngPrice, sngDiscountPrice As Single For intIndex = 0 To 4 sngPrice = CSng(InputBox("Enter price of shirt " & intIndex.ToString)) sngDiscountPrice = sngPrice - (.75 * sngPrice) Next lstResult.Items.Add(sngDiscountPrice) ``` c. ```Dim intIndex As Integer Dim sngPrice, sngDiscountPrice As Single For intIndex = 1 To 4 sngPrice = CSng(InputBox("Enter price of shirt " & intIndex.ToString)) sngDiscountPrice = sngPrice * (.25 - sngPrice) lstResult.Items.Add(sngDiscountPrice) Next ``` d. ```Dim intIndex As Integer Dim sngPrice, sngDiscountPrice As Single For intIndex = 0 To 4 sngPrice = CSng(InputBox("Enter price of shirt " & intIndex.ToString)) sngDiscountPrice = sngPrice * 0.25 lstResult.Items.Add(intIndex & " " & sngDiscountPrice) Next ```
Case B-1Will has been practicing creating basic shapes and is almost ready to work on his first illustration of a flower. Will wants to create an ellipse that is 5 inches wide and 3 inches tall. He should ____.
A. show the rulers, then drag the Ellipse tool and use the rulers for guidance as he draws the shape B. create an ellipse of any size, then change the width and height of the ellipse to 5 and 3 on the Transform panel C. show the grid lines, then drag the Ellipse tool and use the grid lines for guidance as he draws the shape. D. draw the ellipse and use the [shift] key to set the size.
The expression t1.nextaddr->name is evaluated as ____.
A. t1(.nextaddr->name) B. (t1.nextaddr->)name C. t1.(nextaddr->name) D. (t1.nextaddr)->name