import java.util.*;
import java.math.*;


public class ch8java {
public static void main(String[] args) {

System.out.println ("hello world!");

}
}


public class RationalNumber {
private int numerator;
private int denominator;



public RationalNumber() {
this.n = 0;
this.d = 1;
}



public RationalNumber(int n, int d) {
numerator = 0;
denominator = 1;

if (d == 0 || n == 0) {
throw new IllegalArguementException(); }
else if (d == null && n == null) {
denominator = d;
numerator = n;
}
true =RationalNumber.testequals();

}

private int gcd (int n, int d) {
int mx = Math.max(n, d);
int mn = Math.min(n, d);

int remainder =1;
while (remainder != 0 ) {
remainder = mx%mn ;
mx=mn;
mn =remainder;
}







public boolean testEquals(Object Rnumber){
if (n != numerator && d != denominator) {
Rnumber = gcd(n,d);
}
}
public int getDenominator(){
return denominator;
}
public int getNumerator(){
return numerator;
}
public String toString(){
System.out.println(numerator + "/" + denominator);
}




public static void main(String[] args) {
// TODO Auto-generated method stub
System.out.println("I wonder if this will work!");
System.out.println("This is a program for making rational numbers.");
Scanner console = new Scanner (System.in);

System.out.println("Okay now give me an integer!");
RationalNumber.numerator = console.nextInt();

System.out.println("Okay now lets have another?");
RationalNumber.denominator = console.nextInt();

RationalNumber Rnumber = new RationalNumber(numerator, denominator);

System.out.println("Your Rational Number is " +RationalNumber.toString() );



System.out.println("");

}



}
import java.util.*;
import java.math.*;


public class RATIONALNUMBERS {
public static void main(String[] args {


}
}




/**
*
*/
package test;

/**
* @author rs
*
*/
import java.util.*;

public class Rationalnumber {

int num;
int den;

/**
* initialize
*/
public Rationalnumber(int a, int b) {
// TODO Auto-generated constructor stub
if (b == 0 ){ b = 1; }
int g = gcd(num, den);
this.num = num/g;
this.den = den/g;
}

public Rationalnumber(int a) {
this(a, 1);
}

public Rationalnumber setRationalnumber (int a, int b) {
this.num = a;
this.den = b;
Rationalnumber R1 = new Rationalnumber(num/den);
return R1;
}

public Rationalnumber setRationalnumber (int a) {
this.num =a;
this.den =1;
Rationalnumber R1 = new Rationalnumber(num/den);
return R1;

}



private static int gcd (int m, int n) {
int mx = Math.max(m, n);
int mn = Math.min(m, n);

int remainder =1;
while (remainder != 0 ) {
remainder = mx%mn ;
mx=mn;
mn =remainder;
}
return mx;
}


/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
System.out.println("I wonder if this will work!");
System.out.println("This is a program for making rational numbers.");
Scanner console = new Scanner (System.in);

System.out.println("Okay now give me an integer!");
int num = console.nextInt();

System.out.println("Okay now lets have another?");
int den = console.nextInt();

Rationalnumber R1 = new Rationalnumber(num, den);

System.out.println("Your Rational Number is "setRationalnumber(num,den)+"/" +den);



System.out.println("");

}

}
package test;


public class RationalNumber {
private int numerator;
private int denominator;



public RationalNumber() {
this.n = 0;
this.d = 1;
}



public RationalNumber(int n, int d) {
numerator = 0;
denominator = 1;

if (d == 0 || n == 0) {
throw new IllegalArguementException(); }
else if (d == null && n == null) {
denominator = d;
numerator = n;
}
true =RationalNumber.testequals();

}

private int gcd (int n, int d) {
int mx = Math.max(n, d);
int mn = Math.min(n, d);

int remainder =1;
while (remainder != 0 ) {
remainder = mx%mn ;
mx=mn;
mn =remainder;
}







public boolean testEquals(Object Rnumber){
if (n != numerator && d != denominator) {
Rnumber = gcd(n,d);
}
}
public int getDenominator(){
return denominator;
}
public int getNumerator(){
return numerator;
}
public String toString(){
System.out.println(numerator + "/" + denominator);
}




public static void main(String[] args) {
// TODO Auto-generated method stub
System.out.println("I wonder if this will work!");
System.out.println("This is a program for making rational numbers.");
Scanner console = new Scanner (System.in);

System.out.println("Okay now give me an integer!");
RationalNumber.numerator = console.nextInt();

System.out.println("Okay now lets have another?");
RationalNumber.denominator = console.nextInt();

RationalNumber Rnumber = new RationalNumber(numerator, denominator);

System.out.println("Your Rational Number is " +RationalNumber.toString() );



System.out.println("");

}



}
Man14123
Man22341
Man32431
Man43142

Woman14132
Woman21324
Woman31234
Woman44132
/*
Scanner people = new Scanner(new File("ch11.txt"));
ArrayList <Integer> preference = new ArrayList<Integer>();

String line = people.next();
int id = people.nextInt();

System.out.println(line+id);


for (int i=0; i<4; i++){
preference.add(people.nextInt());
}
System.out.println(preference);

*/
/*
Scanner people = new Scanner(new File("ch11.txt"));
ArrayList <Integer> preference = new ArrayList<Integer>();

String line = people.next();
int id = people.nextInt();

System.out.println(line+id);


for (int i=0; i<4; i++){
preference.add(people.nextInt());
}
System.out.println(preference);

*/
/*
man1.add(woman4);
man1.add(woman1);
man1.add(woman2);
man1.add(woman3);

man2.add(woman2);
man2.add(woman3);
man2.add(woman1);
man2.add(woman4);

man3.add(woman2);
man3.add(woman4);
man3.add(woman3);
man3.add(woman1);

man4.add(woman3);
man4.add(woman1);
man4.add(woman4);
man4.add(woman2);



woman1.add(man4);
woman1.add(man1);
woman1.add(man2);
woman1.add(man3);

woman2.add(man2);
woman2.add(man3);
woman2.add(man1);
woman2.add(man4);

woman3.add(man2);
woman3.add(man4);
woman3.add(man3);
woman3.add(man1);

woman4.add(man3);
woman4.add(man1);
woman4.add(man4);
woman4.add(man2);
*/

/*
*
*
*
*
* */


//find out if they are willing to marry them
int teacher(person person, person match) {
if (match.preferences.contains(person) {
int x = match.indexOf(person);
return x;
}
else {
return 921834719234781;

}
System.out.println("this is the juice");
}



//method to remove preferences for putting them in the
grades(person match, int x) {
for(i = match.preferences.size(); i>= x; i--) {
match.preferences.remove(i);
}


student() {
for (i=0; i<4;i++)
c=i
return c
}

principal(nb){
while y=921834719234781;
int y=findtheminlist(nb, nb(student()) )

}


import java.util.*;
import java.math.*;


public class RATIONALNUMBERS {
public static void main(String[] args) {

System.out.println ("hello world!");
}
}

/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
System.out.println("I wonder if this will work!");
System.out.println("This is a program for making rational numbers.");
Scanner console = new Scanner (System.in);

System.out.println("Okay now give me an integer!");
int num = console.nextInt();

System.out.println("Okay now lets have another?");
int den = console.nextInt();

Rationalnumber R1 = new Rationalnumber(num, den);

System.out.println("Your Rational Number is " +R1.+"/" +den);



System.out.println("");

}
 

Popular posts from this blog

a program