1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

10$ to anyone who makes me this Java program

Discussion in 'Members' Lounge' started by 94CivicSlow, Apr 28, 2006.

  1. 94CivicSlow

    94CivicSlow Senior Member

    Messages:
    458
    Likes Received:
    0
    Joined:
    Nov 9, 2004
    Location:
    B0ST0N
    write a program that prompts a user to enter 8 scores each containing 2 decimal places.

    after the 8th score has been entered, add up the score, omitting the lowest and highest scores (ie 6 scores to be added) and output a msg indicating the amount of points.



    :ph34r:
     
  2. EGProject

    EGProject YEEEEAAHHHHH

    Messages:
    2,870
    Likes Received:
    28
    Joined:
    Jun 26, 2004
    Location:
    Whitinsville, Massachusetts
    I can do it in Matlab, but not in Java. Sorry :cry2:

    Ask B- he could probably crank it out in 30 seconds.
     
  3. 94CivicSlow

    94CivicSlow Senior Member

    Messages:
    458
    Likes Received:
    0
    Joined:
    Nov 9, 2004
    Location:
    B0ST0N
    this is what i got

    Code:
    import java.util.*;
    
    public class Score
    {
    static Scanner console = new Scanner(System.in);
    
    public static void main (String[] args)
    
    {
    
    double[] list = new double[8];//create an array of 
    int i, sum, counter;//8 components
    
    System.out.println("Please enter the 8 recorded scores:");
    
    sum = 0
    
    for (i=0; i<list.length; i++)
    list[i] = console.nextDouble();
    
    
     
  4. pills_PMD

    pills_PMD Super Moderator

    Messages:
    4,232
    Likes Received:
    0
    Joined:
    Sep 30, 2002
    Location:
    New Albany, OH

    word to matlab.. i use that shit all the time
     
  5. 94CivicSlow

    94CivicSlow Senior Member

    Messages:
    458
    Likes Received:
    0
    Joined:
    Nov 9, 2004
    Location:
    B0ST0N
    fixed

    Code:
    import java.util.*;
    import java.util.Arrays;
    
    public class list
    {
    static Scanner console = new Scanner(System.in);
    
    public static void main (String[] args)
    
    {
    
    double[] list = new double[8];//create an array of 
     //8 components
    int i;
    double sum; 
    int counter;
    int index; 
    int maxIndex;
    System.out.println("Please enter the 8 recorded scores:");
    maxIndex = 0;
    
    for (i=0; i<list.length; i++)
    list[i] = console.nextDouble();
    Arrays.sort(list); 
    
    sum = (list[1] +list[2] + list[3] + list[4] + list[5] + list[6]);  
    System.out.println("The result of highest and lowest trunication are: ");
    System.out.println();
    
    System.out.println(list[1]); 
    System.out.println(list[2]); 
    System.out.println(list[3]); 
    System.out.println(list[4]); 
    System.out.println(list[5]); 
    System.out.println(list[6]); 
    System.out.println();
    System.out.println("The result of your scores is : " + sum);
    
    
    
    }
    }
     
  6. pissedoffsol

    pissedoffsol RETIRED

    Messages:
    49,693
    Likes Received:
    54
    Joined:
    Sep 28, 2002
    Location:
    Retirement Home
    fuck java with a stick.
     
Verification:
Draft saved Draft deleted

Share This Page