Tuesday, 23 June 2020

25 - Web Designing Question - 05


Which statement will send the value generated by a function procedure, called CalculateTax, back to the calling code in Visual Basic?

(A)    Return Sales*0.08

(B)    CalculateTax = Sales*0.08

(C)    Return CalculateTax (Sales*0.08)

(D)   Both A and B



 

Using Return Sales*0.08

Function CalculateTax(Sales)

Return Sales*0.08

End Function

 

dim total_tax as Double

total_tax = CalculateTax(5000)

MessageBox.Show("Total Tax=" & total_tax & "<br/>")

 

 

Output is

Total Tax=400

 

 

Using CalculateTax = Sales*0.08

Function CalculateTax(Sales)

CalculateTax = Sales*0.08

End Function

 

dim total_tax as Double

total_tax = CalculateTax(5000)

MessageBox.Show("Total Tax=" & total_tax & "<br/>")

 

 

Output is

Total Tax=400

 

So Ans is (D)   Both A and B


No comments:

Post a Comment