Java Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsProgrammingJava Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old October 11th, 2004, 02:25 PM
JavaStudent JavaStudent is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 1 JavaStudent User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Unhappy 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.

Reply With Quote
  #2  
Old October 11th, 2004, 04:00 PM
MadCowDzz's Avatar
MadCowDzz MadCowDzz is offline
I'm Internet Famous
Dev Articles Frequenter (2500 - 2999 posts)
 
Join Date: Jan 2003
Location: Toronto, Canada
Posts: 2,886 MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 1 Week 16 h 19 m 35 sec
Reputation Power: 14
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.

Reply With Quote
  #3  
Old October 14th, 2004, 05:49 PM
SirColdMiser SirColdMiser is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 2 SirColdMiser User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Wink 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

Reply With Quote
  #4  
Old October 16th, 2004, 10:27 AM
michlmann michlmann is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 56 michlmann User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 11
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?

Reply With Quote
  #5  
Old October 17th, 2004, 11:19 AM
m3rajk m3rajk is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 24 m3rajk User rank is Just a Lowly Private (1 - 20 Reputation Level) 
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

Reply With Quote
  #6  
Old October 27th, 2004, 05:02 AM
maxpower3141 maxpower3141 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 2 maxpower3141 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
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..

Reply With Quote
  #7  
Old October 29th, 2004, 08:18 PM
michlmann michlmann is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 56 michlmann User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 11
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

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingJava Development > Ap Java Assignment Help!!!


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.

© 2003-2014 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap