Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: help needed (URGENT)

  1. #1
    Junior Member
    Join Date
    Dec 2013
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation help needed (URGENT)

    had to write a program which is :
    -------------------------------------------------------------------------------------
    Write a java program that calls the following methods:
    1. ReadStudentsData that takes as parameters an array NAMES ofString and another array SCORES of int. It should read an unspecified number of studentsí scores and names. This method will return the number of studentsí data read.
    To stop entering data, the user must type a negative score. A valid score is a number between 0 and 100. Assume that the total number of studentsí data is 10.
    -------------------------------------------------------------------------------------
    and i wrote the java program in grasp as:
    -------------------------------------------------------------------------------------
    import java.util.*;
    import java.lang.*;
    public class assignment3
    {
    static Scanner console=new Scanner (System.in);
    public static void main (String[] args)
    { int assumed_data=10;
    String[] NAMES=new String[assumed_data];
    int[] SCORES=new int[assumed_data];
    int count,aboveavg,belowavg;
    double average;
    count=ReadStudentsData(SCORES,NAMES);
    System.out.println(count);
    }
    public static int ReadStudentsData(int[] SCORES,String[] NAMES)
    {
    int counter=0,i=0;
    while((SCORES[i]<=100)&&(SCORES[i]>=0))
    {
    System.out.println("enter the name of the student = ");
    NAMES[i]=console.nextLine();
    System.out.println("enter the score of the student = ");
    SCORES[i]=console.nextInt();
    counter++;
    i++;
    }
    return counter;

    }
    -------------------------------------------------------------------------------------
    now my program is not evaluated correctly PLEASE HELP


  2. #2
    Junior Member
    Join Date
    Dec 2013
    Location
    Leander, Texas
    Posts
    2
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default Re: help needed (URGENT)

    Could you say more specifically what is not working about it?

  3. #3
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    20,985
    Thanks
    52
    Thanked 2,271 Times in 2,243 Posts

    Default Re: help needed (URGENT)

    Also Please edit your post and wrap your code with code tags:
    [code=java]
    YOUR CODE HERE
    [/code]
    to get highlighting and preserve formatting.
    If you don't understand my answer, don't ignore it, ask a question.

Similar Threads

  1. URGENT HELP NEEDED WITH ALGORITHM PLEASE! PLEASE! .... THANKS
    By Honours in forum Java Theory & Questions
    Replies: 6
    Last Post: March 13th, 2011, 08:40 PM
  2. urgent help needed
    By nono in forum Member Introductions
    Replies: 2
    Last Post: March 10th, 2011, 10:18 AM
  3. Urgent help needed
    By mohit1007 in forum What's Wrong With My Code?
    Replies: 0
    Last Post: June 23rd, 2010, 09:34 PM
  4. Urgent Help needed with java codes
    By makarov in forum Java Theory & Questions
    Replies: 0
    Last Post: November 13th, 2009, 06:23 AM
  5. Urgent code needed
    By subhvi in forum AWT / Java Swing
    Replies: 4
    Last Post: August 27th, 2009, 12:55 AM