Search:

Type: Posts; User: jslice3

Search: Search took 0.08 seconds.

  1. Replies
    3
    Views
    1,134

    [SOLVED] Re: comparing objects using compareTo

    is this what you mean by creating a local odometer and referring to o?



    Odometer od = (Odometer)o;
  2. Replies
    3
    Views
    1,134

    [SOLVED] comparing objects using compareTo

    Im modeling a car odometer, by making an odometer class, where when the user makes a new odometer(n), n is the number of counters shown. for instance an odometer(6) would be 000000 and the be...
  3. [SOLVED] Re: program reads file and prints runs of the same numbers in the form (number of times * number)

    my input file is ten 20s, five 50s, five 60s, one 20, five 30s, and a 0 in a row
    but my output is
    (1 * 50)
    (1 * 60)
    (1 * 20)
    (1 * 30)
    (0)

    ive read over my code multiple times and still dont...
  4. [SOLVED] Re: program reads file and prints runs of the same numbers in the form (number of times * number)

    oh yeah I did, and am still working on it, i was just trying to get a visual layout of what you were saying
  5. [SOLVED] Re: program reads file and prints runs of the same numbers in the form (number of times * number)

    so something like this?



    import java.util.*;
    import java.io.*;

    public class Proj57015 {

    public static void main (String [] args) throws FileNotFoundException{
  6. [SOLVED] Re: program reads file and prints runs of the same numbers in the form (number of times * number)

    sorry, i was wondering why that wasnt working, it said to do that in the "announcements - read if its your first time"



    import java.util.*;
    import java.io.*;

    public class Proj57015 {
    ...
  7. [SOLVED] Re: program reads file and prints runs of the same numbers in the form (number of times * number)

    ok that makes sense, but then how would i go about assigning the next number of a sequence if i cant call .nextInt again?
  8. [SOLVED] program reads file and prints runs of the same numbers in the form (number of times * number)

    so i need the program to read a file with a list of ints, if there are consecutive equal numbers, such as 10 20 20 20 20 30 30 ... 0, the output should be
    (1 * 10)
    (4 * 20)
    (2 * 30)
    etc, and it...
  9. programs reads file and prints runs of the same numbers in the form (number of times * number)

    so i need the program to read a file with a list of ints, if there are consecutive equal numbers, such as 10 20 20 20 20 30 30 ... 0, the output should be
    (1 * 10)
    (4 * 20)
    (2 * 30)
    etc, and it...
Results 1 to 9 of 10