• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

i want some help in writing the code for the below description

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi all,
i want some information regarding the blueJ software which is used to compile and execute an java file and i need some coding for the java programmes which i will sent to you and i want that coding so that i can use it in blueJ to execute so any one interested can send me their email ID so that i can attach my file to them for writing code.
the brief description about the programme is :
The first class to consider is Team. This will hold the data on a single team. The data held will be the name of the team, the number of wins, the number of draws and the number of losses for that team. It should have a single constructor that will set the team name and initialise the numeric values. It will provide getter methods for the attributes. It should also be possible to update the numeric attributes to record the results of a game. Note that the only way to set the team name must be via the constructor � once set it cannot be changed. Our next class is League. This maintains a list of teams in the league. Its attributes will be the name of the league and a list of team objects. You may decide how you store the list of teams. You should provide a constructor which takes the name of the league as a parameter. The constructor should be kept simple. There will be a method to add teams to the league. Another will search for a given team and return the team if it is found otherwise it should return null. There will also be a method to record the result of a match between two teams. This method should take three parameters: the home team name, the away team name and the result for the home team. The result should be a string: �win�, �draw� or �pass�. (Note : if you feel confident you may investigate Java enum). You should also provide a toString method that returns the name of the league and the team details in the form of a league table. (NOTE: you do not need to have sorted the league. This point will be looked at later) NOTE: neither Team nor League have any methods that deal with input or output. It is good object oriented programming practice to separate the I/O from the business classes This brings us to the class LeagueFactory. It has one task: to create a League object. It will do this by means of a method public League createLeague(). This method will collect the necessary data from the user, create and return a new league object. The name of the league should be entered followed by the name of each tea, one name per line. The main I/O for the program is to be contained in the class Controller. This class is expected to have the following attributes: a Scanner and a League. The Controller object will need to know about the league. There will be a menu method to permit the user to interact with the program. The menu will provide four options: Quit exit the program Team get the results for a single team All output the league Result record the result of a match

You will need to write some simple code along the following lines:


get command while ( command is not quit)
{
if command first command process first command
else if
command second
command process
second command �.
get command
}

The final class is LeagueDriver. This class contains the main method which should merely be used to fire off the program.
Note on the All command
It is acceptable to simply output the league in a none sorted order, i.e. as it is recorded in your league list. However, extra marks are available for outputting the league in rank order. Rank order is defined by the number of points a team has: 3 for a win, 1 for a draw and 0 for a loss. In order to output the league in rank order you will need to do a little independent research into the Comparable Interface, and the compareTo method, and the support Java provides for sorting ArrayLists or Arrays.

thanking you

yours sincerely,
NEELA CHARAN KUMAR
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This looks like homework you're supposed to be doing. We don't want to deprive you of the opportunity to learn something (JavaRanch is all about learning), so let's turn the question around: What thoughts do you have on the matter, and where are you stuck implementing it?

Also, you should read DoYourOwnHomework and ShowSomeEffort, as well as the other hints on how to get the most out of JavaRanch: http://faq.javaranch.com/java/HowToAskQuestionsOnJavaRanch
 
Ranch Hand
Posts: 1296
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I agree with Ulf, you must do your own work. When given a list of requirements, it may help if you break the problem down into small pieces. See if you can get the following block of code to compile and print true:

 
charan kumar neela
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Garrett Rowe:
thanks a lot but i am from electronics background and i have joined in computer background at newcastle college in U.K and i am facing a lot of difficulty in doing this problem as i was not having this subject in my degree thats why i have posted this question and could you please frame all the required classes and constructors for me so that i can prepare documentation part on my own as i have two days for completion of my project and it is very new subject for me so i am asking for coding. thank you very much for helping me as i am learning java right now .[QB]

 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


could you please frame all the required classes and constructors for me so that i can prepare documentation part on my own as i have two days for completion of my project and it is very new subject for me so i am asking for coding.



No, sorry. No one here will do this. As we said, we're not interested in helping you cheat. Now, if you want to give it a try yourself, and post your work, we'd be glad to help you by correcting and critiquing it. Otherwise, this is goodbye.
 
charan kumar neela
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
can you please make necessary correction for the below coding for which i have send you the description before


[ EJFH: Don't use the "quote" button, but the "reply" button instead! ]
[ March 16, 2008: Message edited by: Ernest Friedman-Hill ]
 
author
Posts: 23958
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

can you please make necessary correction for the below coding for which i have send you the description before



No... But you can do it. Let's take a look at what you did so far...


The first class to consider is Team. .... done

This will hold the data on a single team. The data held will be the name of the team, the number of wins, the number of draws and the number of losses for that team. ... looks mostly done (okay for now)

It should have a single constructor that will set the team name and initialise the numeric values.

This is you next step. Please take a shot at doing this. And if you can't please elaborate the issue you are having.

Henry
 
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Look at your instructions.

The first class to consider is Team. This will hold the data on a single team. The data held will be the name of the team, the number of wins, the number of draws and the number of losses for that team. It should have a single constructor that will set the team name and initialise the numeric values. It will provide getter methods for the attributes. It should also be possible to update the numeric attributes to record the results of a game. Note that the only way to set the team name must be via the constructor � once set it cannot be changed.



One thing you must do in the Team constuctor is to initialise the variables.
 
charan kumar neela
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Henry Wong:


where to initialize the team name and can you please reply how to do this as this is the first time i am doing java programming and i am facing a lot of difficulty in creating the team, league,controller class

 
author & internet detective
Posts: 42003
911
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by charan kumar neela:
where to initialize the team name and can you please reply how to do this as this is the first time i am doing java programming and i am facing a lot of difficulty in creating the team, league,controller class


As stated above, you should initialize the team name in the constructor. Can you identify the constructor in your code?

We understand that you are new to Java programming. The reason you are getting the answer in little pieces is to help you learn.
 
charan kumar neela
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Jeanne Boyarsky:

Really I am new to this programming that why i am asking for this and this is just a class work which does not give any marks but will give an idea of how to write the coding thatswhy i am asking for the java code, can you please send me the coding for one class so that i can frame for the other class also. thanking you.

 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is not how JavaRanch works. Nobody here will do programming for you. But we'll try to help you get it done once you have shown that you have put some effort into it. You will learn much more that way, which is the goal of JavaRanch.
 
charan kumar neela
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What kinds of errors? If there were compile-time or runtime errors, post them here.
 
Henry Wong
author
Posts: 23958
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

i have tried and done some coding but i am facing some errors while executing it can [you] try




Okay, what coding have you tried? And what errors are you facing?

Or basically, if you tell us where are you stuck, we can help you get unstuck. Tell us exactly what you did. And the errors you are facing. If you provide enough details, we can give you a hint in the right direction.

Henry
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by charan kumar neela:
[QB][/QB]


Hi ,
I have same assignment and I am also new to Java but i dont have issue in implementing this assignment as i already worked at C++ for more than three years. but here the issue is the design diagram which my instructor mailed me with this problm is cofusing me
Please inform me if this is a correct diagram for this problem or not.
If this is corract then please just explain me this diagram.I will be thankfull to you
[ June 21, 2008: Message edited by: Umair Ejaz ]
 
Marshal
Posts: 79965
396
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Umair Ejaz:

Hi ,
I . . . dont have issue in implementing this assignment as i already worked at C++

Welcome to JavaRanch.

Beware: Java is not C++ and C++ is not Java and Java is not an extension of C++. Lots of people who have worked in C++ think the similarities in syntax mean there are similarities in the language and they don't realise that "protected" and "static" mean different things. There are other major differences.

Notice the original poster was warned we are not able to do homework for other people.

Apart from the fact that you have "attributes" and "operations" on that UML diagram where the Java custom would be to write "fields" and "methods": you are going to have to read what your lecturer said on the e-mail with that diagram; it may be that this UML diagram represents the required classes for your assignment. If so, then failing to follow the diagram will lose you lots of marks. You also need to find out whether completing the UML diagram is part of the assignment.

Reading the original post, yes, it appears that UML diagram does correctly describe the assignment. I could copy and paste the original post as an explanation if you wish . . .
 
Umair Ejaz
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks dear for informing me regarding syntax.As i already told i am not asking for solution.Instructor mailed me the same exatly same statment with this diagram,which is originally posted.I cant have contact with instructor for next two days.So please answer my few questions about design diagram,I will be thankfull to you
1)which class will get the input from user,League factory class or controller class.I think ,there sould be a parameter of controller class in creatLeague() of LeagueFactory which wil take the input from user if this is the case then why controller class is assosiated with league driver calss?
2)If controller class obeject used from LeagueDriver class then to whome it will send the data?in LeagueFactory's object???if yes then why there is a creatleague funtion in LeagueFactory as creat command is already been sent from League diver class to controller class and there is no relation in LeagueDriver class and LeagueFatory class...then from where the function of creatleague will be called?
please
[ June 21, 2008: Message edited by: Umair Ejaz ]
 
Henry Wong
author
Posts: 23958
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The problem statement is incredibly detailed -- in fact, it is a bit too detailed as you will never encounter that from an actual client.

It may be better to implement the classes in the order that it is described.

Henry
 
Campbell Ritchie
Marshal
Posts: 79965
396
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Henry Wong:
It may be better to implement the classes in the order that it is described.

Not "may be"; if you are given such a detailed description in an assignment, you must implement it as described, or you will lose marks.
 
Right! We're on it! Let's get to work tiny ad!
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic