Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-13-2007, 12:46 PM
Member
 
Join Date: Dec 2007
Posts: 2
I-Shine is on a distinguished road
The highest number
The application is meant to ask for 10 numbers and print out the highest, here is what I have been able to do:

Code:
import java.io.*; public class ArrayExample { static BufferedReader kbRead = new BufferedReader(new InputStreamReader(System.in)); public static void main(String[] args) throws IOException { int numNames = getInt("Number of names? "); String[] names = new String[numNames]; for (int i = 0; i < names.length; i++) { names[i] = getString("Enter name #" + i); } for (int i = 0; i < names.length; ++i) { System.out.println(names[i]); } } public static int getInt(String prompt) throws IOException { System.out.print(prompt + " "); return Integer.parseInt(kbRead.readLine()); } public static String getString(String prompt) throws IOException { System.out.print(prompt + "The highest number is" + numNames); return kbRead.readLine(); } }
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 12-13-2007, 01:29 PM
Member
 
Join Date: Dec 2007
Posts: 11
gulapala is on a distinguished road
so what do you want?
Whare are you expecting?
what is your result?
__________________
Thanks & Regards, G.Rajasekhar
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 12-13-2007, 02:41 PM
Member
 
Join Date: Dec 2007
Posts: 2
I-Shine is on a distinguished road
Quote:
Originally Posted by gulapala View Post
so what do you want?
Whare are you expecting?
what is your result?
I am trying to get the highest number between 1 - 10
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 02-13-2008, 06:05 AM
Member
 
Join Date: Feb 2008
Posts: 6
winniejr_99 is on a distinguished road
hello.. do you have the method for getting the highest number already?
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
line number kazitula New To Java 3 11-21-2007 11:27 PM
How to get next available number from MS access shahjehan Database 3 11-18-2007 08:41 PM
how to know the number of bytes gabriel New To Java 2 08-06-2007 06:13 PM
how to know the number of the line simon New To Java 3 08-01-2007 05:59 PM
Help with setting number as even or odd fegiflu New To Java 8 07-24-2007 07:07 PM


All times are GMT +3. The time now is 12:59 PM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org