Author Topic: OT: I need help in programming  (Read 1514 times)

0 Members and 1 Guest are viewing this topic.

OT: I need help in programming
« on: October 23, 2014, 06:30:33 PM »

Offline IlCapitano

  • Payton Pritchard
  • Posts: 107
  • Tommy Points: 16
Hi.

I wonder if there's anyone with knowledge about programming in Java and writing code using recursion?

Quote
Exercise: Create a Java program that will take a word from a user and shuffle the letters such that it will exchange 2 characters in the word except the first and the last one. To do this exercise use String methods

This is the problem I need solution for.
Tommy Heinsohn:"Worst nightmare in the NBA is Rondo with a jump shot." B-)

Celtic Pride!

Re: OT: I need help in programming
« Reply #1 on: October 23, 2014, 06:44:09 PM »

Offline BballTim

  • Dave Cowens
  • ***********************
  • Posts: 23724
  • Tommy Points: 1123

  I don't really do java but I've found that almost all of the coding questions you'll have are answered on stackoverflow.com

Re: OT: I need help in programming
« Reply #2 on: October 23, 2014, 06:46:17 PM »

Offline IlCapitano

  • Payton Pritchard
  • Posts: 107
  • Tommy Points: 16
Yeah, I've looked there and I couldn't find it. :(
Tommy Heinsohn:"Worst nightmare in the NBA is Rondo with a jump shot." B-)

Celtic Pride!

Re: OT: I need help in programming
« Reply #3 on: October 23, 2014, 07:52:35 PM »

Offline BballTim

  • Dave Cowens
  • ***********************
  • Posts: 23724
  • Tommy Points: 1123

  Do you have to use recursion? I think those directions are a little vague, but it sounds like you're swapping consecutive characters that aren't first or last, so last would become lsat or little would become ltilte. I'd just split the string and read the characters into an array, then iterate through the array with a for or while loop. The string methods are probably to split the string, determine its length and join the jumbled characters into a string.