• Post Reply Bookmark Topic Watch Topic
  • New Topic

How do you write the codes for these?  RSS feed

 
Charlene Masterson
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Joanne Neal
Rancher
Posts: 3742
16
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm afraid that's not how this site works. See NotACodeMill.
The idea is that you have a go at writing the code and then when you run into any problems you show us what you've written and then explain what the problem is.
For the first one you will need to know about arrays and for loops.
If you don't then here and here are good places to start.
 
Charlene Masterson
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you I did not know. But I see your point thanks anyway.
 
Campbell Ritchie
Marshal
Posts: 56536
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch

I added code tags to your post, and you can see how much better it looks. It will look even better when you have some code written. As Joanne says, you should write some code and show us what it looks like. A hint: the first thing you should write is a public static method to swap elements. Here it isYou notice the documentation comments are probably longer than the whole method
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!