Results 1 to 4 of 4
  1. #1
    BookOfEliX is offline Member
    Join Date
    Feb 2015
    Posts
    20
    Rep Power
    0

    Default Help with java code

    I have to create a program that asks a user to enter an amount for rows and an amount for columns. After they input both amounts, they must fill in the matrix with values (values of double data type). After they enter the values, the program is suppose to search the matrix for the element with the highest value. Once it is found, the user will be prompted with the location of the highest value within the array. I got it to work as to where the user inputs the values and he/she will receive a location of an element. However what they receive is incorrect.

    For example
    "Enter number of rows: 3
    Enter number of columns: 4
    Enter values: 23.5 6 13 2
    1 5 6 3

    7 5 9 2"

    Once they enter the last value, they will be prompted with

    "The highest element is located in 34".

    as you can tell, the highest element is located in 01. I think when the user is prompted with the values that they enter for the rows and columns. How can I modify my code as to where it shows the actual location of the highest value?

    Edit: I can send my code through a private message.
    Last edited by BookOfEliX; 02-11-2015 at 09:36 PM.

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    12,059
    Rep Power
    26

    Default Re: Help with java code

    Moved from Advanced Java to New to Java as there is nothing advanced about the question.

    Please go through the Forum Rules, particularly the third paragraph.

    How can I modify my code
    Impossible to say, as you haven't posted any code.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  3. #3
    BookOfEliX is offline Member
    Join Date
    Feb 2015
    Posts
    20
    Rep Power
    0

    Default Re: Help with java code

    Hey I sent you the code. Let me know what you think.

  4. #4
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    12,059
    Rep Power
    26

    Default Re: Help with java code

    This is a forum, not a helpdesk. Post the code here, but first go through BB Code List - Java Programming Forum - Learn Java Programming.

    I've deleted the PM you sent me.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. Compiling another java code from our code
    By madhav.dubey9 in forum New To Java
    Replies: 18
    Last Post: 03-11-2013, 04:54 PM
  2. Replies: 16
    Last Post: 01-31-2012, 08:36 PM
  3. Replies: 0
    Last Post: 02-21-2011, 11:50 AM
  4. Convert java code to midlet code
    By coldvoice05 in forum New To Java
    Replies: 1
    Last Post: 08-12-2009, 11:14 AM
  5. Convert java code to midlet code
    By coldvoice05 in forum Advanced Java
    Replies: 1
    Last Post: 08-09-2009, 01:21 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •