Thursday, June 5, 2008

I need a public class method called createGenerations() which takes an integer argument called generations and returns no value.

The method should loop generations times. On each pass through the loop- a fair coin is tossed.

If the result of the toss is tails (false)- no Frog objects are generated. However- if the result is heads (true)- then a random number of Frog objects
(between 1 and MAX_NUMBER inclusive) are generated and the coin is tossed a
second time.

If the result of this second toss is tails (false)- no HoverFrog objects are generated. However- if the result is heads (true)- then a random number of HoverFrog objects (between 1 and MAX_NUMBER inclusive) are generated and the coin is tossed a third time.

If the result of this third toss is tails (false)- no MoodyHoverFrog objects are generated. However- if the result is heads (true)- then a random number of MoodyHoverFrog objects (between 1 andMAX_NUMBER_OBJECTS inclusive)
are generated.
At the end of each generation (i.e. at the end of each pass through the loop)- I need to display

• The number of the current generation
• The number of Frog objects created
• The number of HoverFrog objects created
• The number of MoodyHoverFrog objects created

I have an arraylist that contains data (e.g names)

how can append them to text area

i used the following code :
============================================
for (int i = 0 ; i <database.Course201.size();i++){

txt.append("\n"+database.Course201.get(i).toString());
}
============================================

also how can i add items to arraylist that exists in another class?

cant install anymore java games because i get an error message saying i dont have enough space to install- but i got 8gb of storage space on my microsd card. what am i doing wrong?

here is the code:

public class tutor5
{
public static void main(String[] args) throws Exception
{
char door- alley;

System.out.printline("you are presented with a blue and red door which will you choose?");
System.in.read(); System.in.read();
System.out.printline("R for red and B for blue");
door = (char)System.in.read(); System.in.read(); System.in.read();

if (door = r)
{System.out.println("sorry you died");}
else
{System.out.println("now you see a light and dark alley which way willl you go?");}

System.in.read(); System.in.read();
System.out.println(" D for dark- L for light");
alley = (char)System.in.read(); System.in.read(); System.in.read();

if ( alley = L);
{System.out.println("sorry you died");}
else
{System.out.println ("congratulations you won");}

}
}

Visual Basic 2006 or Express Edition s
Any Version of Java.

I need the differences and similuarities of both programming languages.

The key differences- pros and cons on them both- any bugs- uses of both languages- ease of use!!!

Please could you answer in much detail.
Full stars for the best answer!
Thanks for all your suggestions- however could you possible list maybe some uses of both programming langauges.

Like what would you use Java to program something?

Same with Visual Basic if you get me!
Thanks for all your suggestions- however could you possible list maybe some uses of both programming langauges.

Like what would you use Java to program something?

Same with Visual Basic if you get me!

I left the apt for just a few minutes and when I came back- my dog had knocked over and drank a tall Java Chip Frap from Starbucks. He seems to be just fine. Should I be concerned? I put him outside for fresh air with a bowl of cold water.

No comments: