overclocker23
n00b
- Joined
- Jun 6, 2004
- Messages
- 9
//a. Write a method
//public void played(Soccerteam other, int myScore, int otherScore)
//that compares the numb of goals scored in a game by this and other teams and increments the appropriate fields (wins, losses, ties) in both teams.
//b. Write a method that returns the team's current number of points (each win is two points, each tie is one point). Write a reset method that zeroes out this team's wins, losses, and ties.
//c. Add fields to kep track of the total number of games played and the total number of goals scored by all teams in a trounament. Modify the played method from Part(a) to update these fields. Add static accessor methods for these fields and a static startTournament method to zero them out.
//d. Write a program that defines three teams, makes them play a few games with each other, then rerports eah tam's points as well as the total number of games played and the total number of goals scored by all teams in the tournament. The program then repeats this for another tournament.
Here's the thing: I am using a Java book to self-taught myself and so far I have been somewhat successful. I have managed to get a basic understanding of concepts, but as chapters advance I find it difficult to comprehend and code. There are times when I can disscet the code and figure out different parts, but unfortunately there isn't a CD or anything included with the book with sample code. I do like Java and have plans to enroll in my school's Java class, but before that I would like to get as much understanding of the subject as possible. Thanks.
And don't waste your time by accusing me of not trying, finding ways to not do my hw and posting before reading the chapter. I don't what is it - a person posts a problem and you get 10 different people accusing the person of lying.
//public void played(Soccerteam other, int myScore, int otherScore)
//that compares the numb of goals scored in a game by this and other teams and increments the appropriate fields (wins, losses, ties) in both teams.
//b. Write a method that returns the team's current number of points (each win is two points, each tie is one point). Write a reset method that zeroes out this team's wins, losses, and ties.
//c. Add fields to kep track of the total number of games played and the total number of goals scored by all teams in a trounament. Modify the played method from Part(a) to update these fields. Add static accessor methods for these fields and a static startTournament method to zero them out.
//d. Write a program that defines three teams, makes them play a few games with each other, then rerports eah tam's points as well as the total number of games played and the total number of goals scored by all teams in the tournament. The program then repeats this for another tournament.
Here's the thing: I am using a Java book to self-taught myself and so far I have been somewhat successful. I have managed to get a basic understanding of concepts, but as chapters advance I find it difficult to comprehend and code. There are times when I can disscet the code and figure out different parts, but unfortunately there isn't a CD or anything included with the book with sample code. I do like Java and have plans to enroll in my school's Java class, but before that I would like to get as much understanding of the subject as possible. Thanks.
And don't waste your time by accusing me of not trying, finding ways to not do my hw and posting before reading the chapter. I don't what is it - a person posts a problem and you get 10 different people accusing the person of lying.