Which of the following statements correctly computes the cost of product? A prod
ID: 3800651 • Letter: W
Question
Which of the following statements correctly computes the cost of product? A product costs $5.99 per unit if less than 50 units are ordered and $4.99 otherwise Dim units As Integer Dim cost As Double units = CInt(txtUnits.Text) a. cost units * 4.99 If units >= 50 Then cost - cost + units * 5.99 End If b. If units 50 Then cost - units * 5.99 End If Assume a sandwich order form contains two check boxes, one to request extra pickles and one to request extra cheese. Will the code below correctly add $0.50 to the order for each desired extra option? If chkPickles.Checked Then cost = cost + 0.50 End If IfchkCheese.Checked Then cost = cost + 0.50 End If a. Yes b. No What is the output of the code? Dim n As Integer = 2 Select Case n Case 4, 5, 6 IbIOut.Text = "A" Case Is > 3 IbIOut.Text =Explanation / Answer
8. Option b
Our condition here if units<50 then cost=units*5.99 otherwise if more than 50 ordered 4.99 is the unit price. Option b implements the correct condition.
9. Yes
Here the if statement's are perfectly valid to add the 0.50 to the total cost if anything cheese or pickle is selected.
10. C
Here C will be printed as the n is declared with integer 2. Then in the case declaration there are 3 cases there on those 3rd case will be executed because n value is other than 4,5,6. So case else will be executed and because of that C will be printed.
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.