Question

Explain why you cannot convert the following If...Then ...ElseIf statement into a Select Case statement: If...

Explain why you cannot convert the following If...Then ...ElseIf statement into a Select Case statement: If dblTemperature = 100 Then intX = 0 ElseIf intPopulation > 1000 Then intX = 1 ElseIf dblRate < .1 Then intX = -1 End If

Homework Answers

Answer #1

1.In simple words we can say that the main reason for which it cannot be converted to select case statement because it contains multiple and different conditions.

2. Select case statement is used to test the equality of a statement having a single conditional expression, after which based on the result the execution goes to the part of the suitable match.

3. In the given question, there are three different comparisons each for temperature, population and rate. Thus if else statement can be used which will keep on checking the condition one after another and finally assign a value to the variable intX based on the true statement.

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Explain why the proof of the Art Gallery Theorem cannot directly be extended to the case...
Explain why the proof of the Art Gallery Theorem cannot directly be extended to the case of polygons with holes? (You need to explain in reasonable detail what part of the proof fails to be true when we consider polygons with holes.)
Do you agree with the following statement? “Efficiency cannot be achieved when externalities exist.” Explain your...
Do you agree with the following statement? “Efficiency cannot be achieved when externalities exist.” Explain your view
Why it cannot display flop? you need to explain rather than just show me another code...
Why it cannot display flop? you need to explain rather than just show me another code MatLab function b=Matrixvector(A,x) n=length(x); b=zeros(n,1); flop=0; for i=1:n for j=1:n b(i)=b(i)+A(i,j)*x(j); flop=flop+2; end end disp(b); disp(flop);
Evaluate the following statement and explain your reasoning: “The theory of relative purchasing power parity cannot...
Evaluate the following statement and explain your reasoning: “The theory of relative purchasing power parity cannot be used to show why or by how much the euro is undervalued or overvalued today against the US$.”
Explain why you did not obtain a 100 % yield. NOTE: “Human error” cannot be used...
Explain why you did not obtain a 100 % yield. NOTE: “Human error” cannot be used as an explanation, we are looking for systematic answers that would always apply.
Explain why you agree or disagree with the following statement: "If the highest marginal income tax...
Explain why you agree or disagree with the following statement: "If the highest marginal income tax rate is reduced, municipal bond yields are likely to go up relative to yields of otherwise similar corporate bonds." (Maximum 3 sentences, maximum 100 words.)
State whether you agree or disagree with the following statement. Explain why. "If a bond fund...
State whether you agree or disagree with the following statement. Explain why. "If a bond fund manager expects interest rates to go up across all maturities, she should consider lengthening (as opposed to shortening) the duration of the fund's portfolio to benefit from this expectation." (Maximum 3 sentences, maximum 100 words.) Bonds A and B are both seven-year bonds with annual coupon payments. Bond A has a higher coupon rate and higher yield. Given this information, is it possible to...
Can you explain why automatic stabilizers cannot be eliminated? Please explain. Can you explain how marginal...
Can you explain why automatic stabilizers cannot be eliminated? Please explain. Can you explain how marginal tax rates are calculated? Please explain. Do you believe an increase in Earned Income Credit on personal income taxes will make the middle and lower-class better-off? Why do you suppose President Trump increased Earned Income Credit? THANK YOU!!
explain in word why you cannot breath thru a long (say 2m) snorkel
explain in word why you cannot breath thru a long (say 2m) snorkel
Do you agree with the following statement? Explain why. The information about a bond’s duration and...
Do you agree with the following statement? Explain why. The information about a bond’s duration and convexity adjustment is sufficient to quantify interest rate risk exposure.