CuadradoAplicacion

CuadradoAplicacion - System.out.println"Cuadrado 2 30...

Info icon This preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
import java.io.*; i public class CuadradoAplicacion { p //Declaro los objetos de tipo Cuadrado public static Cuadrado c1,c2; p public static void main(String args[]){ p //Crear los objetos de tipo Cuadrado c1 = new Cuadrado(); c2 = new Cuadrado(); c c1.setLado(20); c1.setUnidadMedida("centímetros"); c c2.setLado(30); c2.setUnidadMedida("pulgadas"); System.out.println(); System.out.println("*************************************************************** **"); System.out.println("Mi primera aplicación de Java"); System.out.println(); System.out.println("Este sencillo programa lo único que hace es calcular"); System.out.println("el perímetro de dos cuadrados cuyos lados ya están"); System.out.println("predeterminados."); System.out.println(); System.out.println("Cuadrado 1: 20 cm. por lado.");
Image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: System.out.println("Cuadrado 2: 30 pulgadas por lado."); System.out.println(); int perimetroc1 = c1.calculaPerimetro(); System.out.println("El perímetro del Cuadrado 1 es: " + perimetroc1 + " cm."); p int perimetroc2 = c2.calculaPerimetro(); System.out.println("El perímetro del Cuadrado 2 es: " + perimetroc2 + " pulgadas."); p System.out.println(); System.out.println("Creado el 30/Enero/2007. © Elías Hernández Ramírez."); System.out.println(); System.out.println(" Instituto Tecnológico y Estudios Superiores de Monterrey"); System.out.println(); System.out.println("*************************************************************** **"); * } }...
View Full Document

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern