I need help with this ..
i need to create a program for this but i don't know how to do ..
PLEASE help ...
Thanks ...
would appreciate if any kind soul help ...
![]()
First thing: identify clearly the information you need to collect.
Second thing: identify clearly what you need to do with that information.
Third thing: identify, you guessed it, clearly how you can store both sets of information.
Fourth: write code to collect the information.
Fifth: test that code to verify it works.
Sixth: write code to compute additional information.
Seventh: test that code to verify it works.
My guess is that you are on step 1.
Program seems to be pretty simple, I'll post you the answer once I've finished the coding. When do you need this program to be done?
erm ... thanks a lot ..
i need it by monday ..
i'm so sorry that i replied so late.
my e-mail is chocogurl89@gmail.com.
Thanks a lot.
You are Welcome.
I was waiting for your response. And I'll start doing the program tomorrow morning. And hopefully I can reply you tomorrow.
(Sometimes my methods may be lengthier but will be getting the proper output)
Thanks you so much ...
btw may i know wat program do u use for ya prgramming ?
I also just started learning Java, not more than a week either. And for the moment I use only Notepad as my editor. Further thanks only after the code submission please. Don't worry it'll easily be done.
hee , are u quite done with it yet ?
Code:import java.io.*; class TriathlonTiming { public static void main (String [] args) throws Exception{ InputStreamReader isr = new InputStreamReader(System.in); BufferedReader bf = new BufferedReader(isr); String[] names = new String[10]; int[][] time = new int [9][10]; int choiceNo=0; while (choiceNo != 4) { System.out.println("*************Triathlon Timing*************"); System.out.println("1) Enter Participant's timing"); System.out.println("2) Display all participant's timing"); System.out.println("3) Display the Winner"); System.out.println("4) Exit Program"); System.out.println("******************************************"); System.out.print("Please select your choice (1-4) : "); choiceNo=Integer.parseInt(bf.readLine()); System.out.println("******************************************"); System.out.println(); if (choiceNo > 0 && choiceNo <= 4) { if (choiceNo == 1) { System.out.print("Enter No of Participants (max 10): "); int participantsNo=Integer.parseInt(bf.readLine()); for (int count=0; count < participantsNo; count++ ) { System.out.print("Enter athlate's name: "); String[] athlate = new String [participantsNo]; names[count] = (bf.readLine()); System.out.println("Enter timing for Swim : "); System.out.print(" No of hours : "); time[0][count]=Integer.parseInt(bf.readLine()); System.out.print(" No of minutes : "); time[1][count]=Integer.parseInt(bf.readLine()); while (time[1][count] > 59) { System.out.println(" Can't be more than 60, Please re-enter: "); System.out.print(" No of minutes : "); time[1][count]=Integer.parseInt(bf.readLine()); } System.out.print(" No of seconds : "); time[2][count]=Integer.parseInt(bf.readLine()); while (time[2][count] > 59) { System.out.println(" Can't be more than 60, Please re-enter: "); System.out.print(" No of seconds : "); time[2][count]=Integer.parseInt(bf.readLine()); } System.out.println("Enter timing for Bike : "); System.out.print(" No of hours : "); time[3][count]=Integer.parseInt(bf.readLine()); System.out.print(" No of minutes : "); time[4][count]=Integer.parseInt(bf.readLine()); while (time[4][count] > 59) { System.out.println(" Can't be more than 60, Please re-enter: "); System.out.print(" No of minutes : "); time[4][count]=Integer.parseInt(bf.readLine()); } System.out.print(" No of seconds : "); time[5][count]=Integer.parseInt(bf.readLine()); while (time[5][count] > 59) { System.out.println(" Can't be more than 60, Please re-enter: "); System.out.print(" No of seconds : "); time[5][count]=Integer.parseInt(bf.readLine()); } System.out.println("Enter timing for Run : "); System.out.print(" No of hours : "); time[6][count]=Integer.parseInt(bf.readLine()); System.out.print(" No of minutes : "); time[7][count]=Integer.parseInt(bf.readLine()); while (time[7][count] > 59) { System.out.println(" Can't be more than 60, Please re-enter: "); System.out.print(" No of minutes : "); time[7][count]=Integer.parseInt(bf.readLine()); } System.out.print(" No of seconds : "); time[8][count]=Integer.parseInt(bf.readLine()); while (time[8][count] > 59) { System.out.println(" Can't be more than 60, Please re-enter: "); System.out.print(" No of seconds : "); time[8][count]=Integer.parseInt(bf.readLine()); } } } else if (choiceNo==2) { System.out.println("****************************************************************"); System.out.println("Name\t\tSwim\t\tBike\t\tRun"); System.out.println("****************************************************************"); for (int i=0; i<10; i++) { if (names[i] != null) { System.out.print(names[i] + "\t\t" + time[0][i] + ":" + time[1][i] + ":" + time[2][i] + "\t\t" + time[3][i] + ":" + time[4][i] + ":" + time[5][i] + "\t\t" + time[6][i] + ":" + time[7][i] + ":" + time[8][i]); System.out.println(); } } } } else System.out.print("Selection should be 1 to 4 : "); System.out.println(); System.out.println(); } } }
Last edited by AfTriX; 01-27-2007 at 10:05 AM. Reason: Update Code
You only need to find out the first person. Its so simple. Just try it by your self.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks