Results 1 to 14 of 14
Thread: hey guys, i need help
- 03-20-2011, 01:58 AM #1
Member
- Join Date
- Feb 2011
- Posts
- 17
- Rep Power
- 0
hey guys, i need help
ok, so i have this assignment dealng with creating classes, but with the instructions i was given i dont even know how to determine what my objects are. if you guys could help me out that'd be great, thanks. here are the instructions:
"The Toys of the Future company has decided to issue a new line of toy robots. While they are not sure exactly what their robots will look like, they do know the functionality that they will all have. All robots will be able to go forward, turn right, turn left, spin and detect an object in front of it via a sensor. The robot will use a touch sensor to determine whether it has hit an object in front of it, such as a wall. The robot will have two, three, or four wheels, but it will only be driven by two of them: a right wheel and a left wheel. Each wheel will be attached to a motor that controls it."
-
Thank of the nouns as classes and the actions or verbs as methods and work from there.
- 03-20-2011, 02:10 AM #3
Senior Member
- Join Date
- Feb 2010
- Location
- Waterford, Ireland
- Posts
- 748
- Rep Power
- 4
- 03-20-2011, 02:11 AM #4
Member
- Join Date
- Feb 2011
- Posts
- 17
- Rep Power
- 0
ok, so here's what i've come up with:
MOVEMENT
-forward
-left
-right
-spin
SENSOR
-object detection
TOUCH SENSOR
-wall detection
WHEELS
-left wheel
-right wheel
so how does this look?
- 03-20-2011, 02:15 AM #5
Senior Member
- Join Date
- Feb 2010
- Location
- Waterford, Ireland
- Posts
- 748
- Rep Power
- 4
You got alot alot of actions there... not a class description ( none that I can see anyway)
- 03-20-2011, 02:18 AM #6
Member
- Join Date
- Feb 2011
- Posts
- 17
- Rep Power
- 0
what do you mean?
- 03-20-2011, 02:25 AM #7
Senior Member
- Join Date
- Feb 2010
- Location
- Waterford, Ireland
- Posts
- 748
- Rep Power
- 4
I mean you got a few functions/methods
- 03-20-2011, 02:26 AM #8
Member
- Join Date
- Feb 2011
- Posts
- 17
- Rep Power
- 0
no, like, what do you mean by class descriptions?
- 03-20-2011, 02:30 AM #9
Senior Member
- Join Date
- Feb 2010
- Location
- Waterford, Ireland
- Posts
- 748
- Rep Power
- 4
code that accurately implements a noun i.e. all that the functionality it would expose to a user.
- 03-20-2011, 02:35 AM #10
Member
- Join Date
- Feb 2011
- Posts
- 17
- Rep Power
- 0
MOVEMENT
it would probably ask whether it turns right, left, moves forward, or spins around.
SENSOR
it would ask whether it would detect an object in front of it.
TOUCH SENSOR
it would check to see whether it has bumped into a wall or not.
also, here's the second part:
Now, using the objects and classes that you have written, write a program for your robot that allows it to move in a large square. Allow your robot to run in a big two dimensional array and every time the robot encounters a square in your array, turn that square black.
- 03-20-2011, 02:44 AM #11
Senior Member
- Join Date
- Feb 2010
- Location
- Waterford, Ireland
- Posts
- 748
- Rep Power
- 4
Stop theorizing, get to implementing something.. then come back with questions.
- 03-20-2011, 02:47 AM #12
Member
- Join Date
- Feb 2011
- Posts
- 17
- Rep Power
- 0
thats kinda the whole reason i posted in this forum, because i ddnt know
- 03-20-2011, 03:20 AM #13
Senior Member
- Join Date
- Feb 2010
- Location
- Waterford, Ireland
- Posts
- 748
- Rep Power
- 4
nons
I just meant try something see ho
w far or close u are.u can theorize 2death.
-
Nouns/classes:
- Robot
- TouchSensor
- Wall
- Wheel
- Motor
Verbs/Methods
All the behaviors of the above classes
Similar Threads
-
Hey guys!
By Rewl in forum IntroductionsReplies: 0Last Post: 01-06-2011, 02:33 AM -
hi guys
By pvsnmurthy in forum IntroductionsReplies: 0Last Post: 04-16-2009, 08:37 AM -
Hi guys,
By pereira.lawrence.java in forum IntroductionsReplies: 0Last Post: 03-17-2009, 03:55 AM -
What's up guys
By zuriick in forum New To JavaReplies: 8Last Post: 02-06-2009, 04:39 AM -
Hello Guys...
By balaram.bocha in forum IntroductionsReplies: 0Last Post: 02-03-2009, 06:11 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks