Advertisement
Guest User

Untitled

a guest
Apr 16th, 2014
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.io.*;
  2. import java.util.*;
  3.  
  4. public class studentScores {
  5.  
  6. String readout;
  7. int nameIndex;
  8.  
  9. public static void run() throws FileNotFoundException{
  10.  
  11.  
  12. BufferedReader br = new BufferedReader(new FileReader(file));
  13. String line;
  14. while ((line = br.readLine()) != null) {
  15.  
  16. nameIndex = line.indexOf(':');
  17. readout = line.substring(0, nameIndex) + (
  18. }
  19. br.close();
  20.  
  21.  
  22.  
  23.  
  24. }
  25. }
  26.  
  27.  
  28. public static double average(int[] a) {
  29. double sum = 0;
  30. for(int i=0; i<a.length; i++) {
  31.  
  32. sum=sum+a[i];
  33.  
  34. }
  35. return sum/a.length;
  36.  
  37. }
  38.  
  39.  
  40.  
  41.  
  42. public static void tester(){
  43. int[] tests ={90,90,80,80};
  44. System.out.print(average(tests));
  45.  
  46.  
  47. }
  48.  
  49. public static void displayHeader() {
  50.  
  51. System.out.println("Student Name e1 e2 e3 e4 ave");
  52. System.out.println("---------------------------------------------------------");
  53.  
  54. }
  55.  
  56. //public static void displayStudent(String name, scores, double average) {
  57. //Write in terms of name, scores, and average
  58.  
  59. //}
  60.  
  61.  
  62.  
  63.  
  64.  
  65. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement