This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Own code:Output Confusing Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Own code:Output Confusing" Watch "Own code:Output Confusing" New topic
Author

Own code:Output Confusing

Arjun Srivastava
Ranch Hand

Joined: Jun 23, 2010
Posts: 432


Input: 3
Output :how many children do you have 51
your allowance=3900
Input: 5
Output :how many children do you have 53
your allowance=3900
Input: 100
Output :how many children do you have 49
your allowance=14400
Please explain.
Thanks


SCJP 6 | FB : Java Certifications-Help. | India Against Corruption
Stephan van Hulst
Bartender

Joined: Sep 20, 2010
Posts: 3603
    
  14

Take it one step at a time.

1) Print what you want the user to input.
2) Read the user input and parse it to an int.
3) Do the math.
4) Print your output message.
 
jQuery in Action, 2nd edition
 
subject: Own code:Output Confusing
 
Similar Threads
Need help with a cipher assignment
prog of multiple inputs
the argument of method mark() does not work
multiple inputs
Please tell me what is wrong with read method(or the way i am using it).