Does that mean like this?
for (int i = 0; i < Server.length()-1; i++){
if ( currentServer.ping() == false ) {
add currentServer to failedServersList;
Type: Posts; User: ghostheadx
Does that mean like this?
for (int i = 0; i < Server.length()-1; i++){
if ( currentServer.ping() == false ) {
add currentServer to failedServersList;
So, I don't know how to start off this program. I'm not looking for the final answer, but I don't know two things: 1. the objective, 2. what type of thing do I start it off with? A method? I'm pretty...
Here are the concepts that I don't get from computer science. I don't think I learned them well from just the textbook alone. Does anyone know where I could review all of this:
-What is OBOB?
...
Actually, I typed it wrong. The options are:
A. None of the three
B. I and II only
C. II and III only
In my Be Prepared Comp Sci textbook, I ran into this question:
Exercise 3
Assuming that x, y, and z are integer variables, which of the following three logical expressions are equivalent to...
Alright, so I'll take the else statement out. Here's what I have now:
public class BlushingActor extends Critter
{
public void processActors( ArrayList<Actor> actors )
{
Color c =...
Obviously, that includes else statements. Alright, so here's what I have now:
public class BlushingActor extends Critter
{
public void processActors( ArrayList<Actor> actors )
{
...
It's still not working. Here's what I've edited it to:
public class BlushingActor extends Critter
{
public void processActors( ArrayList<Actor> actors )
{
Color c = getColor();
...
Hi, so this exercise has two separate sections of editable code. The assignment is to fix the two errors. Do I need to create a getter method to get rid of the error? Here are the full instructions:...
How would I do that then? What other options do I have in terms of a line of code?
Here is my code and as you can guess, I get the above error. Thanks for the answer. I'd really appreciate if you could also explain why gridworld has such a low functionality level. Is this a...
I got it to work, but sure enough I have another gridworld question that is really a different thread so that's where I'm gonna post it.
Hi, I've been using grid world with my school. It's a part of the eimacs textbook. Could I please have some help with the following code that I wrote for gridworld. It's a very small tad bit of code:...
@GregBrannon
I agree with you. I still don't think I get that part of the book though.
--- Update ---
I mean, that exercise per-say.
I copied the directions from the book to the text book with copy paste:
Write a new class method, insert, for the Item class that takes three arguments — an Item[] array, an Item newItem, and an...
I'm using the eimacs.com online textbook. It's exercise 170. The section is Insertions, subsection #3. It's on page 265.
--- Update ---
By the way, I posted in this old thread you told me to...
Here's my understanding of these things:
Instance variables- They are what one fills in for the parameters, in a specific instance of an object.
Encapsulation- when a variable or data is hidden...
The part about "Item[] array = Item.makeItemArray();" isn't editable. It's a part of the textbook. Why would they do that?
--- Update ---
I'm guessing they want me to define it afterwards?...
@Norm
Lol, I always forget to paste the whle error message. It says:
"error: cannot find symbol
array[i-a] = array[i]"
Hi, so here's the problem. I don't really get the concept of how I "insert" an item into an array. I get a cannot find symbol error when I try to. I think its because I'm losing focus. Could someone...
@mageorge
Oh, no I know. I fixed the "i" to "int i" and it totally almost made it work. I didn't have to change much after that, besides make nEvens = i / 2; and increment nEvens after the loop...
Hey, I made it work. Thanks for referring me to the loops tutorial. I really appreciate it. I'll read it. Here is my code:
public class Item
{
private int myN;
public Item( int n )
Hi, I'm sorry about the last post. I shouldn't just say "I don't get it" as the whole question. It's totally my fault. Anyways, I am having a problem with this code. I get an error no matter what I...
So one compareTo() method can be used in the definition of the other. How is the inner method defined then? I mean originally.
--- Update ---
I don't completely understand the exercise. What am...
Hi, so I have a question about this code. It says that if myID is equal to "t.getID" then return 0. Otherwise, it uses the "compareTo" method, within the definition of a compareTo method. How can a...