Search:

Type: Posts; User: dianac

Page 1 of 3 1 2 3

Search: Search took 0.13 seconds.

  1. Replies
    7
    Views
    807

    [SOLVED] Re: Read in arguments as a String

    I thought about it, but to concatenate I would need to know how many arguments the user set right? The idea would be a generalized code so arguments would become a single string regardless of how...
  2. Replies
    7
    Views
    807

    [SOLVED] Re: Read in arguments as a String

    Thanks, I wrote:

    String str = args.toString();

    String s = str.toLowerCase();

    System.out.print(s);


    But now it is printing the address of s. I need to use method...
  3. Replies
    7
    Views
    807

    [SOLVED] Re: Read in arguments as a String

    I want to change the arguments from the command line to a single string with no upper case. For example, if args[0]= Hello and args[1]= World it would become a string= "hello world"
  4. Replies
    7
    Views
    807

    [SOLVED] Read in arguments as a String

    Hi I am a beginner in Java and need to read the arguments from command line into a String ignoring case.

    I tried


    String s = Arrays.toString(args);
    s = s.toLowerCase();
    ...
  5. Replies
    11
    Views
    3,599

    [SOLVED] Re: Read strings, calculate Hamming Distance

    Hi there, thank you. I had already tried this one before. I think I am not reading in the arguments to a string correctly. Good Luck to you too!!
  6. Replies
    11
    Views
    3,599

    [SOLVED] Re: Read strings, calculate Hamming Distance

    It should be a character, but when I put just a it returns an error saying I should declare variable a.
  7. Replies
    11
    Views
    3,599

    [SOLVED] Re: Read strings, calculate Hamming Distance

    When I try:


    for(String s:args){
    if (s.toLowerCase().indexOf("a"){
    }



    It keeps returning error for "a" and it just say "no suggestions available". Do you know what I am...
  8. Replies
    11
    Views
    3,599

    [SOLVED] Re: Read strings, calculate Hamming Distance

    Thanks. But how do I refer to characters in the arguments?

    if(args[]:s=="A"||"c"||"C"||"g"||"G"||"t"||"T"){
    }


    This code is not right, I actually want to refer to characters...
  9. Replies
    11
    Views
    3,599

    [SOLVED] Read strings, calculate Hamming Distance

    Hi, I am trying to learn java and would like some help in:

    1.Read in a list of strings of chracters A,C,G,and T (ignoring case). Ignore the string if it contains any other character.
    2.Store the...
  10. Thread: Lagnton Ant

    by dianac
    Replies
    41
    Views
    4,312

    [SOLVED] Re: Lagnton Ant

    how to do this?
  11. Thread: Lagnton Ant

    by dianac
    Replies
    41
    Views
    4,312

    [SOLVED] Re: Lagnton Ant

    package simulation;

    import core.Direction;

    /**
    *
    * Ant class
    *
    *
    */
  12. Thread: Lagnton Ant

    by dianac
    Replies
    41
    Views
    4,312

    [SOLVED] Re: Lagnton Ant

    package simulation;

    import core.Direction;

    /**
    *
    * Ant class
    *
    *
    */
  13. Thread: Lagnton Ant

    by dianac
    Replies
    41
    Views
    4,312

    [SOLVED] Re: Lagnton Ant

    Sorry, still in EAST:

    The member enum EAST can only be defined inside a top-level class or interface
    Syntax error, insert "EnumBody" to complete BlockStatements
  14. Thread: Lagnton Ant

    by dianac
    Replies
    41
    Views
    4,312

    [SOLVED] Re: Lagnton Ant

    package simulation;

    import core.Direction;

    /**
    *
    * Ant class
    *
    *
    */
  15. Thread: Lagnton Ant

    by dianac
    Replies
    41
    Views
    4,312

    [SOLVED] Re: Lagnton Ant

    It worked because I imported direction I suppose. That's why I don't understand. I have imported it as well in 24 and is showing error on EAST.
  16. Thread: Lagnton Ant

    by dianac
    Replies
    41
    Views
    4,312

    [SOLVED] Re: Lagnton Ant

    I am not sure. It is not showing any errors, but I did not run. It won't compile because it depends on Ant.java which is the one with this error on EAST
  17. Thread: Lagnton Ant

    by dianac
    Replies
    41
    Views
    4,312

    [SOLVED] Re: Lagnton Ant

    21 is in another class.

    Here is the one the is not working:

    package simulation;

    import core.Direction;


    /**
  18. Thread: Lagnton Ant

    by dianac
    Replies
    41
    Views
    4,312

    [SOLVED] Re: Lagnton Ant

    No need to answer my last question as I already imported Direction. I am trying to stub methods just to have the program running first. But I am having a problem.


    package simulation;

    import...
  19. Thread: Lagnton Ant

    by dianac
    Replies
    41
    Views
    4,312

    [SOLVED] Re: Lagnton Ant

    In:

    public void executeStep() {
    switch (originalDirection) {
    case NORTH:
    antcurrentI++;
    break;
    case SOUTH:
    antcurrentJ++;
    break;
  20. Thread: Lagnton Ant

    by dianac
    Replies
    41
    Views
    4,312

    [SOLVED] Re: Lagnton Ant

    public void executeStep() {
    switch (originalDirection) {
    case NORTH:
    antcurrentI++;
    break;
    case SOUTH:
    antcurrentJ++;
    break;
    case EAST:
    antcurrentJ++;
  21. Thread: Lagnton Ant

    by dianac
    Replies
    41
    Views
    4,312

    [SOLVED] Re: Lagnton Ant

    Now I defined it at the class level:

    public void executeStep() {
    switch (originalDirection) {
    case NORTH:
    antrow=antcurrentI+1;
    break;
    case SOUTH:
    antrow = antcurrentI-1;...
  22. Thread: Lagnton Ant

    by dianac
    Replies
    41
    Views
    4,312

    [SOLVED] Re: Lagnton Ant

    Thanks.

    But how to set this variables to the ants new position.

    to execute step i wrote:


    public void executeStep() {
    switch (originalDirection) {
    case NORTH:
  23. Thread: Lagnton Ant

    by dianac
    Replies
    41
    Views
    4,312

    [SOLVED] Re: Lagnton Ant

    It could go Right, Left, Below and Up.

    I know how to change rows and columns values, I just don't understan which variables refer to column and row in this code since I am supposed to follow what...
  24. Thread: Lagnton Ant

    by dianac
    Replies
    41
    Views
    4,312

    [SOLVED] Re: Lagnton Ant

    I have to fullfill with code a package called simulation with 3 classes. The first is in post 1

    Tha seconde is




    package simulation;

    /**
  25. Thread: Lagnton Ant

    by dianac
    Replies
    41
    Views
    4,312

    [SOLVED] Re: Lagnton Ant

    The idea is that the ant is in a 2 dim array, but no array is declared

    I don't understand this question:

    Would a move be to an adjacent square?
    Would there be 4 possible squares to move to...
Results 1 to 25 of 69
Page 1 of 3 1 2 3