You are on page 1of 1

/*

* To change this license header, choose License Headers in Project Properties.


* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package area_carro;
import java.util.Scanner;
/**
*
* @author SISTEMAS
*/
public class Area_carro {
final static public double PI = 3.14159265;
static double area(double r1, double r2, double a1, double a2, double b1
, double b2){
double a;
a= (r1*r1*PI)+ (r2*r2*PI) + (a1*b1) + (a2*b2);
return a;
}
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
Scanner scanner = new Scanner(System.in);
double a1;
double a2;
double b1;
double b2;
double r1;
double r2;
System.out.println("Por favor ingrese a1: ");
a1 = scanner.nextDouble();
System.out.println("Por favor ingrese a2: ");
a2 = scanner.nextDouble();
System.out.println("Por favor ingrese b1: ");
b1 = scanner.nextDouble();
System.out.println("Por favor ingrese b2: ");
b2 = scanner.nextDouble();
System.out.println("Por favor ingrese r1: ");
r1 = scanner.nextDouble();
System.out.println("Por favor ingrese r2: ");
r2 = scanner.nextDouble();
System.out.println("el par pertenece al conjunto " + area(r1, r2, a1, a2, b1
, b2));
}
}

You might also like