Racional

# Racional - if(num&amp;amp;gt;=0) return false; else return...

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

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(){

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: if(num&gt;=0) return false; else return true;} r public boolean esCero(){ if(num==0 &amp;&amp; den==1) return true; else return false;} r public boolean esPositivo(){ if(num&gt;=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&amp;amp;gt;=0) return false; else return...

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

View Full Document
Ask a homework question - tutors are online