| | |
If You Are Profesional In Data Base..come On Here.
Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Mar 2008
Posts: 4
Reputation:
Solved Threads: 0
i hope you can solve this problem during 1 hour.
Answer all of the following questions.
a. Create a Student class that has:
i. Two instance variables, name and id.
ii. Two constructors with the following headers :
public Student(int id, String name)
public Student(int id)
iii. Two get (accessor) methods for the two instance variables.
iv. An appropriate toString method
v. A compareTo method with the following header:
protected int compareTo(Comparable object)
that does the comparison based on student id’s.
b. Write a class, MatchingVisitor, whose constructor takes an instance of Comparable (target) as argument and finds whether the target exists in the container. Your visitor should have two additional methods as described below:
public boolean isFound() : returns true if a match is found, false otherwise.
public Comparable getMatch() : returns the reference to the matched object if found, null otherwise.
Note: Your visitor must stop the search as soon as it finds a match.
c. Write a menu-driven application that makes use of the Container and PrintingVisitor classes of lab01, the Student and the MatchingVisitor classes described above to maintain a record of students.
You application should have at least the following options:
Add a student Reads a student information from the user and adds it to the container.
Find a student Reads a student id from the user and finds if it exists in the container using the MatchingVisitor. If found, the full detail of the student should be displayed, otherwise an appropriate message is displayed.
List all students Prints all students in the container using a printing visitor
Exit Exit the application.
thanks,alot...
Answer all of the following questions.
a. Create a Student class that has:
i. Two instance variables, name and id.
ii. Two constructors with the following headers :
public Student(int id, String name)
public Student(int id)
iii. Two get (accessor) methods for the two instance variables.
iv. An appropriate toString method
v. A compareTo method with the following header:
protected int compareTo(Comparable object)
that does the comparison based on student id’s.
b. Write a class, MatchingVisitor, whose constructor takes an instance of Comparable (target) as argument and finds whether the target exists in the container. Your visitor should have two additional methods as described below:
public boolean isFound() : returns true if a match is found, false otherwise.
public Comparable getMatch() : returns the reference to the matched object if found, null otherwise.
Note: Your visitor must stop the search as soon as it finds a match.
c. Write a menu-driven application that makes use of the Container and PrintingVisitor classes of lab01, the Student and the MatchingVisitor classes described above to maintain a record of students.
You application should have at least the following options:
Add a student Reads a student information from the user and adds it to the container.
Find a student Reads a student id from the user and finds if it exists in the container using the MatchingVisitor. If found, the full detail of the student should be displayed, otherwise an appropriate message is displayed.
List all students Prints all students in the container using a printing visitor
Exit Exit the application.
thanks,alot...
•
•
Join Date: Apr 2006
Posts: 164
Reputation:
Solved Threads: 10
Even though I got a two-word easy answer for you, I am not writing it here to show respect to the board regulation.
I can say only two things to you:
1) If you think you are such a smart that you can make other people to do your homework, then I will say you are sleeping. Wake up and start working.
2) No one will answer any of your questions. Yes, most of us are professionals, but it is not out job to solve your problem. It doesn't matter if it takes "1 hour" or 2 min. Just don't be jerk!
Good luck!
I can say only two things to you:
1) If you think you are such a smart that you can make other people to do your homework, then I will say you are sleeping. Wake up and start working.
2) No one will answer any of your questions. Yes, most of us are professionals, but it is not out job to solve your problem. It doesn't matter if it takes "1 hour" or 2 min. Just don't be jerk!
Good luck!
A Perfect World
•
•
Join Date: Mar 2008
Posts: 4
Reputation:
Solved Threads: 0
NO..NO..NO..ORKO
u have to understand that, i have solved this problem tow days ago during 53 min.
and i also want to say tow things:
1)I WILL POST MY SOLUTION TOMORROW IF U WANT.
2)AND MY MAIN AIMS WERE TO KNOW MY ACTUAL LEVEL , AND IF THERE ARE DIFFERENT IDEAS TO SOLVE THIS Q.
*AND I WANT U TO KNOW SOME THING WE ARE HERE FOR THE SAME AIM WHICH IS "LEARNING"..ALSO DO NOT THINK U ARE THE SMARTEST PERSON IN THE WORLD MY FRIEND.
i am waiting for ur solution max. until 8 a.m. ..after 6 hours,else i will post the solution..ok orko?
u have to understand that, i have solved this problem tow days ago during 53 min.
and i also want to say tow things:
1)I WILL POST MY SOLUTION TOMORROW IF U WANT.
2)AND MY MAIN AIMS WERE TO KNOW MY ACTUAL LEVEL , AND IF THERE ARE DIFFERENT IDEAS TO SOLVE THIS Q.
*AND I WANT U TO KNOW SOME THING WE ARE HERE FOR THE SAME AIM WHICH IS "LEARNING"..ALSO DO NOT THINK U ARE THE SMARTEST PERSON IN THE WORLD MY FRIEND.

i am waiting for ur solution max. until 8 a.m. ..after 6 hours,else i will post the solution..ok orko?
Last edited by first001; Mar 2nd, 2008 at 6:40 pm. Reason: something important
For all we know you could be lying about being able to solve the problem so that we would give you the solution. A lot of teenagers come through here trying to get us to cheat for them.
Last edited by jasimp; Mar 2nd, 2008 at 6:48 pm.
"Argyou not with the hand you are dealt in cards or life." ---- Wizard and Glass
•
•
Join Date: Apr 2006
Posts: 164
Reputation:
Solved Threads: 10
first001, I never said I am even a smart one. I try my best to help some one in my free times if I know the answer. I neither have any intention to compete with you nor interested to see your solution for the problems.
See your thread title and the questions you have posted. They clearly have no relation with database and you are asking database professionals to solve them. I don't think you even have any idea what database is. You are funny and disrespectful. A small kid may bit you in programming; yet deserves respect from you. Thanks god I am one of the younger ones here. There are a lot of senior programmers with huge knowledge. I am feeling awkward how they will feel after reading this challenge from someone who just knows how to create a simple class with simple gui.
Thanks jasimp for clearing this out.
See your thread title and the questions you have posted. They clearly have no relation with database and you are asking database professionals to solve them. I don't think you even have any idea what database is. You are funny and disrespectful. A small kid may bit you in programming; yet deserves respect from you. Thanks god I am one of the younger ones here. There are a lot of senior programmers with huge knowledge. I am feeling awkward how they will feel after reading this challenge from someone who just knows how to create a simple class with simple gui.
Thanks jasimp for clearing this out.
A Perfect World
![]() |
Other Threads in the Java Forum
- Previous Thread: Searching an array
- Next Thread: Help! advise needed to finish project.
| Thread Tools | Search this Thread |
911 addball addressbook android api append applet application array arrays automation binary bluetooth button character chat class classes client code component css csv database eclipse ee error event exception fractal ftp game givemetehcodez graphics gui html ide image input integer j2me japplet java javaarraylist javaee javaprojects jmf jni jpanel julia jvm key linked linux list loan loop map method methods mobile netbeans newbie objects oriented output panel phone print printf problem program programming project projects recursion replaydirector reporting researchinmotion robot rotatetext scanner screen se server service set size sms software sort sql string swing test threads transfer tree ubuntu windows






