Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write an Android phone program such that three instances of EditText with respec

ID: 3605246 • Letter: W

Question

Write an Android phone program such that three instances of EditText with respective texts "Input the first positive integer", "Input the second positive integer", and "Input the third positive integer", one instances of Button with text "Right Triangle?", and one instance of TextView are displayed vertically on the AVD. The users of your program will be asked to in- put a positive integer in the first instance of EditText, a positive integer in the second in- stance of EditT ext, and a positive integer in the third instance of EditText. When the users click the button instance, the answer (either "yes" or "no") for the question that the three input integers can the lengths of three edges of a right triangle will be displayed in the in- stance of Textview. In addition, if the answer is "yes", the area of the right triangle should also be displayed

Explanation / Answer

import java.util.Scanner;

class LargestOfThreeNumbers

{

   public static void main(String args[])

   {

      int x, y, z;

      System.out.println("Enter three integers ");

      Scanner in = new Scanner(System.in);

      x = in.nextInt();

      y = in.nextInt();

      z = in.nextInt();

      if ( x > y && x > z )

         System.out.println("First number is largest.");

      else if ( y > x && y > z )

         System.out.println("Second number is largest.");

      else if ( z > x && z > y )

         System.out.println("Third number is largest.");

      else  

         System.out.println("Entered numbers are not distinct.");

   }

}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote