|
 |
|
Dev Articles Community Forums
> Programming
> Java Development
|
Ap Java Assignment Help!!!
Discuss Ap Java Assignment Help!!! in the Java Development forum on Dev Articles. Ap Java Assignment Help!!! Java Development forum discussing Java, JSP, J2ME. Get help with Java and all of its related languages, libraries and variations. If it’s Java-related, you can discuss it here.
|
|
 |
|
|
|
|

Dev Articles Community Forums Sponsor:
|
|
|

October 11th, 2004, 02:25 PM
|
|
Registered User
|
|
Join Date: Oct 2004
Posts: 1
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
Ap Java Assignment Help!!!
My end of the quarter test is on this method based program that entails us AP computer
students to write a program that take input from the user in the forms of points, points
and slope, parallel to a given line, or perpendicular to a certian line multiple times until
the user stops.
they then want us to output this data in an array, and in a JApplet in the form of a graph.
From there we have to find intersections of the given lines and display a trimmed graph
and an array of the intersection points.
If anyone can help with this program in anyway i would so greatly appreciate it! Thank's my
grade depends on this.
|

October 11th, 2004, 04:00 PM
|
 |
I'm Internet Famous
|
|
Join Date: Jan 2003
Location: Toronto, Canada
Posts: 2,886
 
Time spent in forums: 1 Week 16 h 19 m 35 sec
Reputation Power: 13
|
|
|
writing it yourself would yeild to better knowledge of the programming world.
if programming isn't your best interest, i hope its not too late to drop the course.
|

October 14th, 2004, 05:49 PM
|
|
Registered User
|
|
Join Date: Oct 2004
Posts: 2
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
I need help with an AP Java computer science program
i need help with my computer science, my teacher, who doesn't know anything about computer science and he doesn't teach us anything wants us to write a java program that puts certain names in alphabetical order without using a loop, but with using if and else statements. And you can't make it ten times easier by using Arrays. How can i write a program that can achieve this.
please, someone give me an idea can u send an example to me at KaitenKenbu4@hotmail.com
|

October 16th, 2004, 10:27 AM
|
|
Contributing User
|
|
Join Date: Mar 2004
Posts: 56
Time spent in forums: < 1 sec
Reputation Power: 10
|
|
Quote: | Originally Posted by SirColdMiser i need help with my computer science, my teacher, who doesn't know anything about computer science and he doesn't teach us anything wants us to write a java program that puts certain names in alphabetical order without using a loop, but with using if and else statements. And you can't make it ten times easier by using Arrays. How can i write a program that can achieve this.
please, someone give me an idea can u send an example to me at KaitenKenbu4@hotmail.com |
Recursion?
|

October 17th, 2004, 11:19 AM
|
|
Registered User
|
|
Join Date: Oct 2004
Posts: 24
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
both of you sound like script kiddies. asking for complete code. this place looks good in that they are telling you to write it yourself. like them i will help if you have a specific question, but i will not write your programs.
you should have learned recursion by now, it is not a loop, yet works like one. and with the lack of arrays, are you used to links?
recursion might help both of you
|

October 27th, 2004, 05:02 AM
|
|
Registered User
|
|
Join Date: Sep 2004
Posts: 2
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
Recursion is not a loop??? That is just the definition of a loop!!!
Example:
void somefunction(SomeObject[] objs){
if (objs == null)
return;
for (int i=0;i<objs.lenght;i++)
this.doSomethingtoObject(objs[i]);
}
and
void somefunction(SomeObject[] objs){
if (objs == null)
return;
this.recurse(objs,0);
}
void recurse(SomeObject[] objs,int index){
if (index < 0 || objs == null || index >= objs.length)
return;
this.doSomethingtoObject(objs[index]);
recurse(objs,index+1);
}
Does the same things. So recursion is nothing but a loop.. The above recursion is very stupid and I'am afraid (don't actually know for sure) that in doing it like that, will create unnecessary overhead (by making so many calls to "dynamic" functions), but I suppose that stating the method static would improve the performance.. (Please someone correct me if I'm wrong)
I think that the nicest recursion I have seen is in the QuickSort algorithm - it's simple, easy to understand and it would be a pain to code as a for or while - loop.. But my point is that I think the when thinking whether or not you should use a for/while-type recursion or "calling the method from within" recursion for a particular job, it is best to do the one that is easiest to implement.. Only spend more time on the problem if you have to do it as efficiently as possible..
|

October 29th, 2004, 08:18 PM
|
|
Contributing User
|
|
Join Date: Mar 2004
Posts: 56
Time spent in forums: < 1 sec
Reputation Power: 10
|
|
If I follow your argumentation then our student can't pass the test because everything is a loop:
void somefunction() {
doSomething();
}
void somefunctionwithloop() {
for ( int i=0; i < 1; i++ )
doSomething();
}
Quote: | Originally Posted by maxpower3141
Does the same things. So everything is nothing but a loop.
|
Bye
|
Developer Shed Advertisers and Affiliates
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|