Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package linnell_a_1;
- public class linnell_a_1 {
- public static void main(String[] args) {
- // TODO Auto-generated method stub
- Rat x=new Rat(3,5); //create new fraction
- System.out.println("Fraction: " + x.num + "/" + x.denom);
- System.out.println(x.toDouble());
- }
- }
- prints
- Fraction: 3/5
- 3
- 5
- 0.0
- 3.0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement