Search:

Type: Posts; User: Sociopathic

Search: Search took 0.14 seconds.

  1. Replies
    9
    Views
    714

    Re: User Defined Decimal Precision

    The precision is being called during my switch statements as that is where the value that needs to be formatted is being output. I need precision to be called before toFormat occurs. The variable n...
  2. Replies
    9
    Views
    714

    Re: User Defined Decimal Precision

    import java.text.DecimalFormat;
    import java.util.Scanner;

    class Rational {

    private int numerator;
    private int denominator;

    //constructors
    Rational() {
  3. Replies
    9
    Views
    714

    Re: User Defined Decimal Precision

    How would I go about passing a scanner as an argument. Currently I have two different scanners as when I try to use the scanner from inputR it prompts me to input the precision value twice. I have...
  4. Replies
    9
    Views
    714

    Re: User Defined Decimal Precision

    I would like to use the same scanner from inputR to get the variable n that would be used in toFloat rather than having a separate scanner in that method. As for the output example I am not sure how...
  5. Replies
    9
    Views
    714

    User Defined Decimal Precision

    Return a String representation of a Rational number in floating-point format. (Consider providing formatting capabilities that enable the user of the class to specify the number of digits of...
Results 1 to 5 of 5