Win a copy of Escape Velocity: Better Metrics for Agile Teams this week in the Agile and Other Processes 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

Write a public instance method doSquareDance()

 
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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:
 
Marshal
Posts: 8428
606
Mac OS X VI Editor BSD Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
?
 
Liutauras Vilda
Marshal
Posts: 8428
606
Mac OS X VI Editor BSD Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

lilly Rankine wrote:The code below should help:


Maybe. But it is incorrect.
 
Marshal
Posts: 76464
366
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It looks like what was provided here.
 
Liutauras Vilda
Marshal
Posts: 8428
606
Mac OS X VI Editor BSD Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 2908
150
Google Web Toolkit Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 !
 
Hold that thought. Tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic