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...
Type: Posts; User: dianac
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...
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...
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"
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();
...
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!!
It should be a character, but when I put just a it returns an error saying I should declare variable a.
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...
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...
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...
how to do this?
package simulation;
import core.Direction;
/**
*
* Ant class
*
*
*/
package simulation;
import core.Direction;
/**
*
* Ant class
*
*
*/
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
package simulation;
import core.Direction;
/**
*
* Ant class
*
*
*/
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.
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
21 is in another class.
Here is the one the is not working:
package simulation;
import core.Direction;
/**
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...
In:
public void executeStep() {
switch (originalDirection) {
case NORTH:
antcurrentI++;
break;
case SOUTH:
antcurrentJ++;
break;
public void executeStep() {
switch (originalDirection) {
case NORTH:
antcurrentI++;
break;
case SOUTH:
antcurrentJ++;
break;
case EAST:
antcurrentJ++;
Now I defined it at the class level:
public void executeStep() {
switch (originalDirection) {
case NORTH:
antrow=antcurrentI+1;
break;
case SOUTH:
antrow = antcurrentI-1;...
Thanks.
But how to set this variables to the ants new position.
to execute step i wrote:
public void executeStep() {
switch (originalDirection) {
case NORTH:
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...
I have to fullfill with code a package called simulation with 3 classes. The first is in post 1
Tha seconde is
package simulation;
/**
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...