Está en la página 1de 14

UNIVERSIDAD JUREZ AUTNOMA DE

TABASCO
DIVISIN ACADMICA DE INFORMTICA Y

Asignatura:

Programacin orientada a objeto


Nombre de la prctica:
Ejemplos de diagramas uml y sus programas
Catedrtico:

Gmez de dios Jorge Alberto


Nombre del participante:

Jos francisco Servn moreno

Fecha de entrega:

12/03/2015

Cunduacn, Tabasco Marzo del 2015

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package cuentabancaria;

import javax.swing.JOptionPane;

/**
*
* @author jose francisco servin moreno
*/
public class CuentaBancaria {
private int noCuenta;
private String nombreCliente;
private float saldo;
private int edad;
private String fechaInicio;
private char sexo;

public static void main(String[] args) {


CuentaBancaria tarjeton = new CuentaBancaria();

tarjeton.setNoCuenta(Integer.parseInt(JOptionPane.showInputDialog("Inserte el
numero de cuenta")));
tarjeton.setNombreCliente(JOptionPane.showInputDialog("Inserte el
nombre"));
tarjeton.setEdad(Integer.parseInt(JOptionPane.showInputDialog("Edad del
Cliente")));
tarjeton.setSexo(JOptionPane.showInputDialog("Sexo del cliente F o
M").charAt(0));
tarjeton.setSaldo(Float.parseFloat(JOptionPane.showInputDialog("Ingreso
para dar de alta")));
tarjeton.setFechaInicio(JOptionPane.showInputDialog("Fecha de hoy"));
String datos= "No cuenta "+tarjeton.getNoCuenta()+"\n"+
"Nombre "+tarjeton.getNombreCliente()+"\n"+
"saldo"+tarjeton.getSaldo();
JOptionPane.showMessageDialog(null, datos);

tarjeton.setDeposito(Float.parseFloat(JOptionPane.showInputDialog("cantidad a
depositar")));
datos= "No cuenta "+tarjeton.getNoCuenta()+"\n"+
"Nombre "+tarjeton.getNombreCliente()+"\n"+
"saldo"+tarjeton.getSaldo();
JOptionPane.showMessageDialog(null, datos);

tarjeton.setRetiro(Float.parseFloat(JOptionPane.showInputDialog("cantidad
a retirar")));
datos= "No cuenta "+tarjeton.getNoCuenta()+"\n"+
"Nombre "+tarjeton.getNombreCliente()+"\n"+

"saldo"+tarjeton.getSaldo();
JOptionPane.showMessageDialog(null, datos);

/**
* @return the noCuenta
*/
public int getNoCuenta() {
return noCuenta;
}

/**
* @param noCuenta the noCuenta to set
*/
public void setNoCuenta(int noCuenta) {
this.noCuenta = noCuenta;
}

/**
* @return the nombreCliente
*/
public String getNombreCliente() {
return nombreCliente;
}

/**
* @param nombreCliente the nombreCliente to set
*/
public void setNombreCliente(String nombreCliente) {
this.nombreCliente = nombreCliente;
}

/**
* @return the saldo
*/
public float getSaldo() {
return saldo;
}

/**
* @param saldo the saldo to set
*/
public void setSaldo(float saldo) {
this.saldo = saldo;
}

/**
* @return the edad
*/
public int getEdad() {

return edad;
}

/**
* @param edad the edad to set
*/
public void setEdad(int edad) {
this.edad = edad;
}

/**
* @return the fechaInicio
*/
public String getFechaInicio() {
return fechaInicio;
}

/**
* @param fechaInicio the fechaInicio to set
*/
public void setFechaInicio(String fechaInicio) {
this.fechaInicio = fechaInicio;
}

/**
* @return the sexo

*/
public char getSexo() {
return sexo;
}

/**
* @param sexo the sexo to set
*/
public void setSexo(char sexo) {
this.sexo = sexo;
}
public void setRetiro(float ret)
{
if (ret>saldo)
JOptionPane.showMessageDialog(null,"Saldo insuficiente");
else
saldo-=ret
}
}

/*
* 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 figurasgeoabstractas;

/**
*
* @author jose francisco servin moreno
*/
public abstract class Figuras {
private float base;
private float altura;
private float radio;
private float lado;

static float PI=3.1416f;

/**
* @return the base
*/
public float getBase() {
return base;
}

/**
* @param base the base to set
*/
public void setBase(float base) {
this.base = base;
}
/**
* @return the altura
*/
public float getAltura() {
return altura;
}
/**
* @param altura the altura to set
*/
public void setAltura(float altura) {
this.altura = altura;
}

/**
* @return the radio
*/
public float getRadio() {
return radio;
}

/**
* @param radio the radio to set
*/
public void setRadio(float radio) {
this.radio = radio;
}
/**
* @return the lado
*/
public float getLado() {
return lado;
}
/**
* @param lado the lado to set
*/
public void setLado(float lado) {
this.lado = lado;
}

public abstract float getArea();

public abstract float getPerimetro();

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package cuadradoycubo;

import javax.swing.JOptionPane;

/**
*
* @author Efesd
*/
public class CuadradoyCubo {
private int x;
private int n;
private int resul1;
private int resul2;

public static void main(String[] args) {

JOptionPane.showInputDialog("Inserte el numero "));

/**
* @return the x
*/
public int getX() {
return x;
}

/**
* @param x the x to set
*/
public void setX(int x) {
this.x = x;
}

/**
* @return the n
*/
public int getN() {

return n;
}

/**
* @param n the n to set
*/
public void setN(int n) {
this.n = n;
}

/**
* @return the resul1
*/
public int getResul1() {
return resul1;
}

/**
* @param resul1 the resul1 to set
*/
public void setResul1(int resul1) {
this.resul1 = resul1;
}

/**
* @return the resul2

*/
public int getResul2() {
return resul2;
}

/**
* @param resul2 the resul2 to set
*/
public void setResul2(int resul2) {
this.resul2 = resul2;
}
}

También podría gustarte