Carteles.java 1.6 KB
Newer Older
willgonzz committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
import java.util.Scanner;
import java.util.Scanner;
public class Carteles implements CartelesInterface{
    String texto;
    Carteles(String T){
        texto=t;
    }
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        System.out.println("Ingrese el texto que desea imprimir en el cartel:");
        String texto=scanner.nextLine();
        System.out.println("Ingrese la forma que desea utilizar para su cartel");
        System.out.println("1-circulo\n2-rectangulo");
        int a=scanner.nextInt();
        if(a==1){
            System.out.println("ingrese el radio:");
            int d=scanner.nextInt();
            System.out.println("ingrese el color:");
            String c=scanner.nextLine();
            Circulos C=new Circulos(d,c);
            if(C.cartelesCirculos(texto)){
                System.out.println("el cartel se podra hacer");
            }else{
                System.out.println("el cartel no se podra hacer, el texto excede al radio");
            }
        }else{
            System.out.println("Ingrese la anchura:");
            int d=scanner.nextInt();
            System.out.println("Ingrese la altura:");
            int b=scanner.nextInt();
            System.out.println("ingrese el color:");
            String c=scanner.nextLine();
            Rectangulos R=new Rectangulos(d,b,c);
            if(R.cartelesRectangulo(texto)){
                System.out.println("el cartel se podra hacer");
            }else{
                System.out.println("el cartel no se podra hacer, el texto excede a la longitud");
            }
        }
        

    }

}