Jump to content

URGENT !!! I need help !!!

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
16 replies to this topic

#1
icycold89

icycold89

    Newbie

  • Members
  • Pip
  • 8 posts
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 ...


Posted Image

#2
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
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.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#3
AfTriX

AfTriX

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 586 posts
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?

#4
icycold89

icycold89

    Newbie

  • Members
  • Pip
  • 8 posts
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.

#5
AfTriX

AfTriX

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 586 posts
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)

#6
icycold89

icycold89

    Newbie

  • Members
  • Pip
  • 8 posts
Thanks you so much ...
btw may i know wat program do u use for ya prgramming ?

#7
AfTriX

AfTriX

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 586 posts
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.

#8
icycold89

icycold89

    Newbie

  • Members
  • Pip
  • 8 posts
hee , are u quite done with it yet ?

#9
AfTriX

AfTriX

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 586 posts
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();

  }

 }

}


#10
AfTriX

AfTriX

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 586 posts
You only need to find out the first person. Its so simple. Just try it by your self.

#11
icycold89

icycold89

    Newbie

  • Members
  • Pip
  • 8 posts
Thanks a lot ..
but i just want to know how to put when i press on ChoiceNo 4 , i also want to print out Press any key to continue ...
i tried puting this : else if (choiceNo==4)
System.out.println("Press any key to continue....");

but it does not sees to work ... it just automatic end the system ..
may i know where must i put htis coding ? thanks a lot ...

#12
AfTriX

AfTriX

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 586 posts
You can try to get help from SideWinder, the Mod of this Forum. I learn Java through his tutorials and so. And this doesn't seem to be a difficult thing but since I'm working on a PC which doesn't have JDK installed right now. So I'm not able to assist you for now. You better can try online resources to find out more helps. Since you have only one day left, that is the only good way as far as I concern.