Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a Java Function to get the class average using ethe current roster automation that reads the CSV file. import java.io . BufferedReader; import java.io

Write a Java Function to get the class average using ethe current roster automation that reads the CSV file. import java.io.BufferedReader;
import java.io.FileReader;
public class RosterAutomation {
public static void main(String[]args){
//Map studentMap = new HashMap();
/*
* ID Name quiz 10/2% Test-1/50/10%| Mid-Term /50/30%| Test-3/30/10% Final /50/40% Presentation 2% Coding Project/6%
*23207161 Philip Don 104250224926
*
* quiz /2%=(10/10)*2=2
* Test-1/50/10%=(42/50)*10=8.4
* Mid-Term /50/30%=(50/50)*30=30
* Test-3/30/10%=(22/30)*10=7.3
* Final /50/40%=(49/50)*40=39.2
* Presentation 2%=(2/2)*2=2
* Coding Project/6%=(6/6)*6=6
*-------------------------------------------------
* Total Score =94.9 letter grade: A
*
**/
var line ="";
var splitBy =",";
var fileName ="C:\\Users\\marefin\\Downloads\\class_roster_project.csv";
try {
FileReader fileReader = new FileReader(fileName);
BufferedReader br = new BufferedReader(fileReader);
System.out.println(br.readLine());
line = br.readLine();
// array : 0123456789
// value ="23207167,Dindyal,Rajendra N,10,45,50,30,49,2,6"
while(line != null){
System.out.println(line);
String[] values = line.split(splitBy);
String id = values[0];
String firstName = values[1];
String lastName = values[2];
double quiz = Double.parseDouble(values[3]);
double test1= Double.parseDouble(values[4]);
double midterm = Double.parseDouble(values[5]);
double test3= Double.parseDouble(values[6]);
double finalTest = Double.parseDouble(values[7]);
double presentation = Double.parseDouble(values[8]);
double project = Double.parseDouble(values[9]);
line = br.readLine();
}
} catch (Exception e){
throw new RuntimeException(e.toString());
}
}
}
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Concepts Of Database Management

Authors: Philip J. Pratt, Joseph J. Adamski

4th Edition

ISBN: 0619064625, 978-0619064624

More Books

Students also viewed these Databases questions