The input to a program is three integer values. The three values are interpreted as representing three sides of a triangle. The program prints a message that states whether the triangle is scalene, isosceles, or equilateralScalene – all three sides are of the triangle have different lengthsIsosceles – any two sides of the triangle have same lengthsEquilateral – all the three sides have equal lengths Write test cases (i.e., specific sets of data) that you feel would adequately test this program. Automate the above written test cases using QTP.

Showing Answers 1 - 6 of 6 Answers

ManjuPillae

  • Mar 26th, 2008
 

'Lets take sideA, sideB and sideC as sides of Triangle.

Dim sideA, sideB, sideC
Dim flag

flag = 1

sideA = inputBox("Enter The Side 1 Of Triangle", "Input")
If ((isNumeric(sideA) = 0) OR sideA = 0) then
 flag = 0
End If

sideB = inputBox("Enter The Side 2 Of Triangle", "Input")
If ((isNumeric(sideB) = 0) OR sideB = 0) then
 flag = 0
End If

sideC = inputBox("Enter The Side 3 Of Triangle", "Input")
If ((isNumeric(sideC) = 0) OR sideC = 0) then
 flag = 0
End If


If flag = 1 then
 If sideA = sideB And SideA = sideC then
  MsgBox "Equilateral – all the three sides have equal lengths"
 Else
  If sideB = sideC OR sideA = sideC OR sideA = sideB then 
   MsgBox "Isosceles – any two sides of the triangle have same lengths"
  Else
   MsgBox "Scalene – all three sides are of the triangle have different lengths"
  End If
 End If
Else
 MsgBox "InValid Please Enter Only Numbers"
End If

mahendar1234

  • Mar 26th, 2008
 


Dim a,b,c

a=inputbox("enter a number")
b=inputbox("enter a number")
c=inputbox("enter a number")

If (a=b and a<>c) or (a=c and a<>b) or (b=c and b<>a) Then

'<> indicates "Not equal"
   print("isosceles")

else if (a=b and a=c) then

   print("equilateral")

else

print("scalene")     

End If
end if

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions