File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
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: 3646
    
  16

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.
 
Don't get me started about those stupid light bulbs.
 
subject: Own code:Output Confusing