Material_formacion_4_01.pdf - I Introducción a la...

This preview shows page 1 out of 5 pages.

Estatuto while Sintaxis while ( condición ) estatuto; Si se requiere realizar más de un estatuto se deben utilizar llaves. while ( condición ) { bloque de estatutos; } Aquí se ejecuta el (los) estatuto (s) mientras la condición es verdadera; al momento de ser falsa termina el ciclo. Si la condición es falsa la primera vez nunca se ejecuta(n) el (los) estatuto(s). Ejemplo: Applet que toma la cantidad de dinero a invertir, el porcentaje de inversión mensual y el dinero que se quiere tener invertido finalmente y va desplegando en un campo (TextArea) el nuevo saldo mes tras mes. import java.awt.*; import java.applet.*; import java.awt.event.*; // <applet width="300" height="400" code="AppletCiclos1"></applet> public class AppletCiclos1 extends Applet implements ActionListener { Label l1, l2, l3,l4; TextField t1, t2,t3; TextArea ta; Button b; public AppletCiclos1() { l1 = new Label("Inversión Inicial"); t1 = new TextField(8); l2 = new Label("% interes mensual"); t2 = new TextField(5); l3 = new Label("Inversión Final"); I. Introducción a la programación orientada a objetos y al lenguaje JAVA
Image of page 1
You've reached the end of this preview.
  • Spring '19
  • Estatuto, Programación orientada a objetos, Cifra, TextField(8

{[ 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