To change it all to boolean takes to long. there is only one error left. an out of bounderies error, could you see it?
code:
import java.util.*;
import java.io.*;
class GameOfLife{ // main...
Type: Posts; User: ProgrammerNoobE
To change it all to boolean takes to long. there is only one error left. an out of bounderies error, could you see it?
code:
import java.util.*;
import java.io.*;
class GameOfLife{ // main...
When I execute my program it gives an error :
java.lang.ArrayIndexOutOfBoundsException: 6
at Field.numNeighbours(GameOfLife.java:131)
at Field.generationNextCalc(GameOfLife.java:164)
at...
Thank you again!
I think I'm almost there, just have my doubts about the output
My recent code:
import java.util.*;
import java.io.*;
My new code:
import java.util.*;
import java.io.*;
class GameOfLife{ // main class
Field field = new Field();
It reads the file
Then calculates the number of rows(lines)
I added 2, because I want to make a border around it
I tried to write a program such as the game of life, but without the sourcecode of the game of life. Just with the things I learned so far.
It is not quit clean, but when it works it is fine to...
Stupid of me! scanner = new Scanner (System.in);
Thank you!
Thank you for your fast reply!
I tried to locate it, but I just don't see it. Only in this class the variabel numberOfGenerations is used and it is initialized just before the user is asked for...
Hello,
I need some help, because I just don't see it!
This is my code:
class GameOfLife{ // main class
Field field = new Field();
Thank you for your clear explanation! But I have still 1 question, how do I add a new account with a name which is entered by the user and an initial balance of 0? I want to do that in the enroll...
I don't understand you. I'm a beginner in Java, so I'm not familiair with everything. How do I define the accounts.equals in my Account class? And do you know why my accound.add(account); doesn't...
Hello,
The comments in the code are my specified questions about the code. Please help me with finding the proper solution. I searched on the web, but I did not find the right solution for my...
I understand what you say, but I just don't know how it works, could you give me a hint?
what I have right now:
void enroll(String name){
if(account.equals(account)){
...
I don't know what you mean. Could you explain it with an example? I'm not so familiair with english terms, because I'm from Holland.
[/COLOR]Your ArrayList holds accounts. Why are you passing a String into the contains() method?[/QUOTE]
I've put name in it, because when the user types a command like enroll "name" it should only...
My program looks now like this:
import java.util.Scanner;
import java.util.ArrayList;
class Bank{
double balance;
//Account account;
Thank you PhHein,
Am I in the right direction now?
import java.util.Scanner;
import java.util.ArrayList;
class Bank{
Pleas help me!
I have a problem with my ArrayList, I don't understand how the user input should be stored in the ArrayList and how I can print the ArrayList
my code:
import...
Thank you very much, I searched in the coursereader for information about arraylists, but what I don't understand is how I have to print the accounts?
import java.util.Scanner;
import...
I also tried it with this code:
import java.util.Scanner;
import java.util.ArrayList;
class Bank{
double balance;
//Account account;
Thank you very much, it is working better now!
Now I'm stuck on the array part. I don't really understand arrays and now I have to make a print of multiple accounts of people. How do I have to do...
Hello PhHein,
Thank you for your fast replies!
Could you explain it a little bit more, I'm a dutch student and I'm not really good with English terms so maybe you could explain it with some...
sorry for this mistake, I've changed it now
This is the code I have so far, but it does not work :( I think I choose the wrong constructor, because in the assignment stands that the class Bank should be the main class, so that should be the...
4 Banking
You are going to build a simple system of bank accounts. The program reads commands from input and executes them on the accounts (such as withdrawals, deposits, enrolling of new...