Computer Science, asked by sneha413639, 4 months ago

please answer my question. ​

Attachments:

Answers

Answered by Oreki
1

Code:

public class Sample {

   double a, b, c;

   void coordinates(double x, double y, double z) {

       a = x;

       b = y;

       c = z;

   }

   double compute( ) {

       return (b * b) - (4 * a * c);

   }

   public static void main(String[ ] args) {

       Sample sample = new Sample( );

       double a = 10.5, b = 20.0, c = 5.5;

       sample.coordinates(a, b, c);

       double area = sample.compute( );

       System.out.printf("A - %.2f, B - %.2f and C - %.2f\n", a, b, c);

       System.out.printf("Area - %.2f unit square", area);

   }

}

Output:

   A - 10.50, B - 20.00 and C - 5.50

   Area - 169.00 unit square

Similar questions