Fractional Calculator in Java
- by user2888881
I am trying to create a fractional calculator in Java with inputs of mixed fractions, proper fractions, improper fractions or integers. It should include the four basic operators as well. The program should be set up as a loop where it is continuous until the user types "quit".
I have coded the beginning loop but have no idea where to go from there.
Please help, I am a beginner and would really appreciate it.
Thank you again.
This is what I have so far:
import java.util.*;
public class FractionCalculator {
private static Scanner input;
public static void main(String[] args) {
input = new Scanner(System.in);
String x = "quit";
System.out.println("Enter a fraction");
while (true) {
String y = input.next();
if (y.equals(x)) {
break;
}
}
}
}