This week's book giveaways are in the Jython/Python and Object-Oriented programming forums.
We're giving away four copies each of Machine Learning for Business: Using Amazon SageMaker and Jupyter and Object Design Style Guide and have the authors on-line!
See this thread and this one for details.
Win a copy of Machine Learning for Business: Using Amazon SageMaker and JupyterE this week in the Jython/Python forum
or Object Design Style Guide in the Object-Oriented programming forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Knute Snortum
Sheriffs:
  • Liutauras Vilda
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Joe Ess
  • salvin francis
  • fred rosenberger

Write a public instance method doSquareDance()

 
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Write a public instance method doSquareDance() that takes no arguments and returns no value. It should walk the StickFigure along the four sides of a square of sides 150 in an anticlockwise direction. This means beginning with right ('R'), then up ('U'), left ('L') and finally down ('D') so that the StickFigure returns to its starting position.

The code below should help:
 
Sheriff
Posts: 7421
504
Mac OS X VI Editor BSD Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
?
 
Liutauras Vilda
Sheriff
Posts: 7421
504
Mac OS X VI Editor BSD Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

lilly Rankine wrote:The code below should help:


Maybe. But it is incorrect.
 
Marshal
Posts: 67464
257
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It looks like what was provided here.
 
Liutauras Vilda
Sheriff
Posts: 7421
504
Mac OS X VI Editor BSD Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Campbell Ritchie wrote:It looks like what was provided here.


I'm glad it wasn't an instructor who provided such a code.
 
Bartender
Posts: 2472
108
Google Web Toolkit Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

lilly Rankine wrote:Write a public instance method ...The code below should help: ...


It sounds like you are giving us your assigment to complete
I would suggest having a look at our forum rules here: How To Ask Questions On Java Ranch Specifically, NotACodeMill and ShowSomeEffort.

How does that code help? I dont see any method called "doSquareDance" in your code anywhere !
 
Seriously Rick? Seriously? You might as well just read this tiny ad:
Sauce Labs - World's Largest Continuous Testing Cloud for Websites and Mobile Apps
https://coderanch.com/t/722574/Sauce-Labs-World-Largest-Continuous
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!