Results 1 to 2 of 2
  1. #1
    theseven is offline Member
    Join Date
    Feb 2010
    Posts
    3
    Rep Power
    0

    Default How to A, B C, D, E,F change to 5,4,3,2,1,0 java

    public class Main_2 {

    static String[] deptCode = {"HRO", "FIN", "IT", "SALES"};
    static String[] employeeID = {"1", "2", "3", "4", "5", "6", "7", "8"};
    static char[][] marks = { {'F', 'D', 'C', 'B', 'C', 'B', 'C', 'A'}, // mark for HRO
    {'D', 'B', 'A', 'A', 'F', 'B', 'C', 'C'}, // mark for FIN
    {'D', 'B', 'E', 'B', 'C', 'F', 'F', 'D'}, // mark for IT
    {'C', 'B', 'E', 'D', 'C', 'B', 'C', 'A'} }; // mark for SALES

    /**
    * @param args the command line arguments
    */
    public static void main(String[] args) {


    // TODO code application logic here
    int deptID = -1;


    for (int i = 0; i < deptCode.length; i++) {
    if (args[1].equals(deptCode[i])) {
    deptID = i; ////// ******* //////
    break;
    }
    }
    double sum=0;
    int maxID=0;
    int nEmployee=employeeID.length;
    for (int i=0; i < nEmployee; i++ ){
    sum+=marks[deptID][i]; // add up all the marks for the department
    if(marks[deptID][maxID]<marks[deptID][i]) maxID=i; // find student who has maximum
    }
    sum/=nEmployee; // calculate average
    System.out.println("HRO: Average performance = " + sum); // output average
    System.out.println("Max mark belongs to studentID = "+ maxID);
    // output max mark

    }


    }

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,315
    Blog Entries
    1
    Rep Power
    26

Similar Threads

  1. how to change windows xp background image through java
    By erosenthil in forum Advanced Java
    Replies: 1
    Last Post: 08-18-2009, 01:57 PM
  2. change the square to triangle java
    By anotsu in forum New To Java
    Replies: 3
    Last Post: 07-09-2009, 12:17 PM
  3. change premissions in java (like chmod in unix)
    By itaipee in forum New To Java
    Replies: 0
    Last Post: 03-10-2009, 02:18 PM
  4. assignement change the java screensaver
    By anotsu in forum New To Java
    Replies: 2
    Last Post: 03-07-2008, 01:28 AM
  5. How to change the default Java
    By integrator in forum New To Java
    Replies: 4
    Last Post: 02-01-2008, 04:19 PM

Posting Permissions

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