Results 1 to 5 of 5
  1. #1
    Join Date
    Feb 2011
    Posts
    5
    Rep Power
    0

    Default I need a java program that takes scores and ouputs average, highest, and lowest score

    Write a program that collects a series of scores (from tests, SOU football, basketball, golf…) from a user. Make sure the data is okay and when the user is done entering data, print out some statistics about those scores.

    Data validation, make sure the following are not entered
    Negative numbers
    No numbers
    Numbers bigger than 65535, the total can be larger than 65535, but no single number can be.


    The program should then:
    1. The average score
    2. The highest Score
    3. The lowest score

  2. #2
    sunde887's Avatar
    sunde887 is offline Moderator
    Join Date
    Jan 2011
    Location
    Richmond, Virginia
    Posts
    3,069
    Blog Entries
    3
    Rep Power
    8

    Default

    I would like some beer.

    it should not be budweiser, miller, or other generic crap.

    Thanks.

  3. #3
    Join Date
    Feb 2011
    Posts
    5
    Rep Power
    0

    Default

    I am going to be taking a computer science class next term and I want to just see what codes look like and how they work.
    These are just some prompts I found in my friends textbook.
    I don't know how to write them yet I just want to look at them and watch them run.

  4. #4
    doWhile is offline Moderator
    Join Date
    Jul 2010
    Location
    California
    Posts
    1,641
    Rep Power
    7

    Default

    want to just see what codes look like and how they work.
    If this is the case then break the problem down, and google each portion of the problem (user input, average, etc...). You will found thousands of code listings that do each of these and you can take the approach you have chosen. You shouldn't expect a members of a forum to spend their valuable time doing it for you.
    That being said I recommend you take a different approach: start at the tutorials linked below and learn the basics of the java language, from primitives to operators to arrays to classes and objects. Grinding through problem solving and learning the documentation that the tutorials below provide is one of the more important aspects a newcomer can learn.
    Trail: Learning the Java Language (The Java™ Tutorials)

  5. #5
    sunde887's Avatar
    sunde887 is offline Moderator
    Join Date
    Jan 2011
    Location
    Richmond, Virginia
    Posts
    3,069
    Blog Entries
    3
    Rep Power
    8

    Default

    like doWhile said, watching it run wont really help you much. It will be much better for your learning to figure these out yourself. They are basic problems, read a bit of the tutorials, then look at the scanner api, almost everything you want to do can be done with a few just that. Figure out some basic syntax, give it a shot and post your code here, I, and many other will help you if you put in the effort.

    Ill help you get started. For this problem you will need a scanner(check the api, google scanner java api)
    You will also need an int array, and 3 ints, look up how to declare them and use them, it should be early in the tutorials.
    You will need if else to control program flow/validate numbers.
    You will need a for loop.
    Finally, you will need to use a few System.out.println and/or System.out.print statements.

    Here is an extremely basic examples of using some of this
    Java Code:
    //find the factorial of some user input number
    //a factorial is 1 * 2 * 3 ... n-1 * n
    public class Factorial{
      public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        int input, output = 1;
        System.out.println("Please enter a number:");
        input = scan.nextInt()
    
        for(int i = 1; i <= input; i++){
          output *= i;
        }
        System.out.println("The factorial of " + input + " is " + output);
      }
    }

Similar Threads

  1. Need Lowest and Highest decimal point for 0.73 and 0.76
    By maran.ramar in forum New To Java
    Replies: 5
    Last Post: 11-15-2010, 02:58 AM
  2. cant get highest and lowest to display
    By tracey in forum New To Java
    Replies: 2
    Last Post: 05-16-2010, 09:48 AM
  3. QuickSort highest lowest Situation
    By Tenn in forum New To Java
    Replies: 17
    Last Post: 05-06-2009, 05:37 AM
  4. Replies: 21
    Last Post: 11-05-2008, 03:31 PM
  5. Test score average
    By ryn21 in forum New To Java
    Replies: 11
    Last Post: 10-17-2008, 06:49 AM

Posting Permissions

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