Racional - if(num>=0) return false; else return...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
public class Racional{ p public int num; public int den; p public Racional(){ num=0; den=1;} d public Racional(int n, int d){ num = n; den = d;} d public Racional(Racional r){ num = r.getNum(); den = r.getDen();} d public Racional(int whole){ num = whole; den = 1;} d //Gets y Sets public int getNum(){ return num;} r public int getDen(){ return den;} r public void setNum(int n){ num = n;} n public void setDen(int d){ den = d;} d //Otros métodos / public boolean esNegativo(){
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: if(num>=0) return false; else return true;} r public boolean esCero(){ if(num==0 && den==1) return true; else return false;} r public boolean esPositivo(){ if(num>=0) return true; else return false;} r public Racional reciproco(){ return (new Racional(dem,num);} r r /* public Racional division(Racional r){ int numx = 0; int denx = 0; numx = num*r.den; denx = r.num*denm; return numx denx;}*/ r }...
View Full Document

This note was uploaded on 10/29/2009 for the course ITC TC-1002 taught by Professor X during the Spring '09 term at ITESM.

Page1 / 2

Racional - if(num>=0) return false; else return...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online