Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.*;
- import java.util.*;
- public class studentScores {
- String readout;
- int nameIndex;
- public static void run() throws FileNotFoundException{
- BufferedReader br = new BufferedReader(new FileReader(file));
- String line;
- while ((line = br.readLine()) != null) {
- nameIndex = line.indexOf(':');
- readout = line.substring(0, nameIndex) + (
- }
- br.close();
- }
- }
- public static double average(int[] a) {
- double sum = 0;
- for(int i=0; i<a.length; i++) {
- sum=sum+a[i];
- }
- return sum/a.length;
- }
- public static void tester(){
- int[] tests ={90,90,80,80};
- System.out.print(average(tests));
- }
- public static void displayHeader() {
- System.out.println("Student Name e1 e2 e3 e4 ave");
- System.out.println("---------------------------------------------------------");
- }
- //public static void displayStudent(String name, scores, double average) {
- //Write in terms of name, scores, and average
- //}
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement