Question 1 (1 point) What is the value of i when the code is complete? decimal m
ID: 3881490 • Letter: Q
Question
Question 1 (1 point)
What is the value of i when the code is complete?
decimal monthlyInterestRate = .01m;
int months = 10;
decimal futureValue = 1000m;
int i = 1;
while (i < months)
{
futureValue = futureValue * (1 + monthlyInterestRate);
i++;
}
Question 1 options:
10
9
12
11
1
Save
Question 2 (1 point)
What is the value of discount after these statements are executed?
orderTotal=50;
quantity=10;
if (quantity == 1 || quantity == 2)
discount = 0;
else if (quantity >= 3 && quantity <= 10)
discount = orderTotal * .1;
else if (quantity > 10 && quantity <= 25)
discount = orderTotal * .2;
else
discount = orderTotal * .3;
Question 2 options:
10
.1
5
15
0
Save
Question 3 (1 point)
If you code a break statement in a loop, it will cause the application ______.
Question 3 options:
to halt execution of the program itself
to jump to the beginning of the loop
to jump to the end of the loop
to enter debug mode
to restart the loop
Save
Question 4 (1 point)
What is the value of discount after these statements are executed?
orderTotal=50;
quantity=2;
if (quantity == 1 | quantity == 2)
discount = 0;
else if (quantity >= 3 && quantity < 10)
discount = orderTotal * .1;
else if (quantity >= 10 && quantity < 25)
discount = orderTotal * .2;
else
discount = orderTotal * .3;
Question 4 options:
5
10
15
.3
0
Question 8 (1 point)
What is the value of sum when the code is completed?
int sum = 0;
for (int i = 2; i < 10; i += 2)
{
sum += i;
}
Question 8 options:
30
54
20
55
10
Question 10 (1 point)
What is the value of i when the code is complete?
decimal monthlyInterestRate = .01m;
int months = 10;
decimal futureValue = 1000m;
int i = 1;
do
{
futureValue = futureValue * (1 + monthlyInterestRate);
i++;
}while (i < months)
Question 10 options:
1
9
2
10
11
10
9
12
11
1
Explanation / Answer
Dear STudent,
below are the answers..
================================================================
Ans:1
10
===============================================================
Ans:2
5
===============================================================
Ans:3
to jump to the end of the loop
===============================================================
Ans:4
0
===============================================================
Ans:5
===============================================================
Ans:8
20
================================================================
Ans:10
10
===============================================================
KIndly Check and Verify Thanks...!!!
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.