• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

please help meeeee

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
2. Write a Java program that will reverse any input integer number. For example, if the user enters 1439, your program must find 9341, or if -628 entered, -826 must be cretaed (the output must also be an integer).
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm sorry Burak, but we try not supply direct answers to assignment/interview questions or provide ready made code samples (please, have a read of this).

We will however help you work through the coding problems you are having. So, what have you tried? Can you post the code you've got so far? Or if you've got nothing, can you explain what is confusing you?
 
Burak Tass
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
 
Paul Sturrock
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
...and what seems to be going wrong? What issues are you having?
 
Burak Tass
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
But we should't use boolean without boolean how can do this and i have to do this with output i have to give numbers and it should be reversed this numbers not Strings
 
lowercase baba
Posts: 13089
67
Chrome Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So.. does that code compile? does it run? does it die? does it give you the wrong output? What were you expecting, what did it give you?

folks here will BEND OVER BACKWARDS to help you - but you have to make it easy for them. Everyone volunteers their time, and the harder it is for them to help you, the less likely they are to help.

Just a friendly tip!

also, you should learn to use the code tags. click that 'code' button above where you enter your post, and you'll see them. then paste your source code between them to preserve your spacing. It makes the code about 1000% easier to read.
 
Burak Tass
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please help me i have to do this now if i can't do this i will fail in exam
 
author
Posts: 23951
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Burak Tass wrote:Please help me i have to do this now if i can't do this i will fail in exam



Well, first, you can get rid of all the prime() stuff -- that for a different homework problem.

As for reverse(), it looks like you have written one that will reverse a string. Now, you just need to convert number to string and back -- and take care of negative numbers too. Pretty straightforward, give it a shot...

Henry
 
Burak Tass
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ok I see you don't help me and i will fail if you don't send me codes
 
fred rosenberger
lowercase baba
Posts: 13089
67
Chrome Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Burak Tass wrote:ok I see you don't help me and i will fail if you don't send me codes


I am a professional coder. I write Java, Perl, C/C++ and other languages for a living.

I would be happy to provide the answer to ALL three of your problems at my standard rate of $300 / hour, with a four hour minimum. Once you have deposited the money into my paypal account, I will start writing your code for you, and provide it to you as soon as possible.

You may be able to find cheaper folks here.

Let me be blunt:

DO NOT ASK FOR SOMEONE TO GIVE YOU THE SOLUTION AGAIN IN ANY OF YOUR THREE THREADS.
 
Ranch Hand
Posts: 710
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I will start by apologizing to the orignal poster if I am incorrect in my next set of statements.

Judging by your other threads, and the fact you are asking us to write code for you, I highly doubt the code you posted was written by you. Not only is it pretty lengthy code (albeit not that complex) but huge chunks of it do not relate to the problem you are asking us about.

With that said, Henry has pretty much told you EXACTLY what you have to do. I would suggest a quick google search for "java convert int to string" and "java convert string to int" will probably tell you how to do what you require.

And, since I haven't seen it mentioned by anyone else yet, UseAMeaningfulSubjectLine.
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Totally off-topic, but I have a towel signed by Douglas Adams.
 
Ranch Hand
Posts: 686
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This sounds like it might be an exercise in recursive programming . The idea of displaying the characters of a string in reverse order, without actually reading the string in reverse order, or without storing the characters in reverse order, is a problem that lends itself to recursive solution.

The following link may be of use to you.

http://erwnerve.tripod.com/prog/recursion/
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic