Search:

Type: Posts; User: vysero

Page 1 of 3 1 2 3

Search: Search took 0.09 seconds.

  1. Replies
    1
    Views
    941

    Re: Help with JUnit testing

    Okay well I figured out how to test the contents of my list properly if anyone is wondering here is my test case:


    @Test
    public void testMinCoins() {
    System.out.println("minCoins");...
  2. Replies
    1
    Views
    941

    Help with JUnit testing

    So I am brand spanking new to JUnit testing and code testing in general. I found a helpful guide on YouTube but it only got me so far. I wrote a simple Change Making problem and now I want to do some...
  3. Re: Driver error, null pointer exception when creating an instance of a class?

    Wow, okay I am sorry. I guess I just missed that. Thank you!
  4. Re: Driver error, null pointer exception when creating an instance of a class?

    So its odd because there is no variable in line 8. Line 8 is the method deceleration:


    public static void main(String[] args) throws IOException {

    --- Update ---

    Yeah I can't seem to figure...
  5. Driver error, null pointer exception when creating an instance of a class?

    Okay so I have no idea why this is happening. Its not even a question about methodology I am just wondering if I should build a new project or something at this point because I can't see how/why I am...
  6. Re: Trouble with converting strings to integers, 2D arrays

    Okay so instead of running the loop the size of the original array I need to run it for the size of the second array, is that what your saying? This worked but apparently my attempt at neglecting...
  7. Re: Trouble with converting strings to integers, 2D arrays

    Honestly, I thought that's what I was doing with my first condition statement namely:


    if(array[i][j] != array[0][j])

    That should say hey ignore the first row.

    Now if I set the second...
  8. Re: Trouble with converting strings to integers, 2D arrays

    So I guess what I am trying to avoid is this. Lets say I set up my code like:


    if(array[i][j] != array[0][j]){

    if (array[i][j].equals("\u221E")) {

    ...
  9. Re: Trouble with converting strings to integers, 2D arrays

    Yes I haven't had too much trouble with separating row 0 data. The trouble is with saving the following rows into a separate array. Specifically, this is how I am attempting to ignore the first row...
  10. Trouble with converting strings to integers, 2D arrays

    Eventually I would like to write create a minimum spanning tree using Prim's algorithm. However, I am have having trouble with reading data from a csv text file and converting those strings into...
  11. Re: Saving from csv file and copying contents to a 2D array problems

    Alright great I figured it out. Thanks for your help Norm I appreciate that!
  12. Re: Saving from csv file and copying contents to a 2D array problems

    Okay yeah that makes sense. As you know the input file is:

    A,B,C,D,E,F
    ∞,1,∞,∞,∞,∞
    ∞,5,∞,1,11,∞
    ∞,∞,∞,∞,∞,∞
    5,∞,∞,∞,3,∞
    ∞,∞,∞,11,∞,7
    ∞,∞,3,∞,∞,∞
  13. Saving from csv file and copying contents to a 2D array problems

    So I think I am close; however, I am getting some weird output when I print the contents of my array. So the input file is just a text file not an actual csv file but here is what the contents of the...
  14. Re: Need help with BufferedReader and BufferedWriter

    You Sr. are a genius, thank you!
  15. Re: Need help with BufferedReader and BufferedWriter

    Okay here's my program as I think it should work:


    /*
    * To change this license header, choose License Headers in Project Properties.
    * To change this template file, choose Tools | Templates
    ...
  16. Re: Need help with BufferedReader and BufferedWriter

    Well I can split the string up into tokens separated by spaces. However, I can't seem to figure out how to then take each of those tokens and write them to a file. For instance, if the input file...
  17. Need help with BufferedReader and BufferedWriter

    So given an input file, input.txt. I am trying to write a program that will firstly: print each line from input.txt line by line as it appears in the text file. So lets say the text file says:
    ...
  18. Replies
    2
    Views
    882

    Re: Using Comparable, extends Comparable

    Sorry I am still confused. So here is what I think this might look like:

    In my main in Case 0 (enqueue) just after I pass the values for a/an airline passenger I thought I would write:

    ...
  19. Replies
    2
    Views
    882

    Using Comparable, extends Comparable

    Hello okay so my assignment was to create a priority queue for Airline Passengers. Here is what I have done so far:

    //Driver

    package priorityqueuestandby;

    import...
  20. Replies
    3
    Views
    982

    Re: Comparing Strings

    Hey this is good thank you, however; I am still having issues. So I can get it to print like today's date:


    package testdates;
    import java.text.DateFormat;
    import java.util.Date;

    public...
  21. Replies
    3
    Views
    982

    Comparing Strings

    If I wanted to take strings in from the user through a GUI say day, month, year. I am looking for a way to organize those incoming strings. I am going to add this information to a queue. However, I...
  22. Replies
    25
    Views
    2,200

    Re: JOptionPane help

    Okay so now I am thinking I shouldn't be trying to return anything at all. Which puts me back at square one were void type cannot be converted to Person.
  23. Replies
    25
    Views
    2,200

    Re: JOptionPane help

    Well when I push a person and set it equal to firstLink doesn't that make firstLink a reference to a person object?

    firstLink = new ListNode(person, firstLink);
  24. Replies
    25
    Views
    2,200

    Re: JOptionPane help

    Ah ic so I changed the method type to ListNode but now I can't use the method since its of type Node and Node cannot be converted to Person. Is there any way around this or am I not going to be able...
  25. Replies
    25
    Views
    2,200

    Re: JOptionPane help

    Right but the method isn't actually void. That's why I am so confused. Here is the method:

    public static pop()
    {
    firstLink = firstLink.next;
    return(firstLink);
    }
    ...
Results 1 to 25 of 58
Page 1 of 3 1 2 3