Kindly let me know if more corrections are needed.
Please give a thumps up if you like the answer
Program
import java.util.*;
import java.io.*;
import java.text.DecimalFormat;
public class FileStudent {
public static void main(String[] args) throws
IOException
{
Scanner stdin = new Scanner(new
FileReader("studentsgrade.txt"));
int num_test;
double classAverage=0.0,sumAvg=0.0;
int count=0;
num_test=stdin.nextInt();
System.out.println("Name\tAverage\tLetter Grade");
while(stdin.hasNextLine()) {
sumAvg+=calculateAverage(stdin,num_test);
count++;
}
classAverage=overallAverage(sumAvg,count);
DecimalFormat value =
new DecimalFormat("#.#");
System.out.println("\nThe average
test grade is "+value.format(classAverage));
stdin.close();
}
public static double calculateAverage(Scanner
stdin,int num_test)
{
double
sum=0,test_score;
double avg=0.0;
String
stud_name=stdin.next();
for(int
i=0;i<num_test;i++)
{
test_score=stdin.nextInt();
sum+=test_score;
}
avg=sum/num_test;
String
grade=determineGrade(avg);
System.out.println(stud_name+"\t"+avg+"\t"+grade);
return avg;
}
public static String determineGrade(double
average)
{
if(average>=90)
return "A";
else
if(average>=80)
return "B";
else
if(average>=70)
return "C";
else
if(average>=60)
return "D";
else
return "F";
}
public static double overallAverage(double
sumAvg,int num_stud)
{
double
classAverage=sumAvg/num_stud;
return(classAverage);
}
}
Output
Name Average Letter Grade
Javed 92.4 A
Alan 86.2 B
Brandon 82.0 B
The average test grade is 86.9
studentsgrade.txt
5
Javed 100 90 80 100 92
Alan 85 75 91 95 85
Brandon 90 70 90 80 80
Write a Java program that reads a file until the end of the file is encountered....
Write a javascript program that asks the user to enter five test scores. The program should display a letter grade for each score and the average test score. Write the following methods in the program: calcAverage—This method should accept five test scores as arguments and return the average of the scores. determineGrade—This method should accept a test score as an argument and return a letter grade for the score,
Write a program that asks the user to enter five test scores. The program should display a letter grade for each score and the average test score. Design the following functions in the program: calcAverage—This function should accept five test scores as arguments and return the average of the scores. determineGrade—This function should accept a test score as an argument and return a letter grade for the score (as a String), based on the following grading scale: Round the average...
[JAVA/chapter 7] Assignment: Write a program to process scores for a set of students. Arrays and methods must be used for this program. Process: •Read the number of students in a class. Make sure that the user enters 1 or more students. •Create an array with the number of students entered by the user. •Then, read the name and the test score for each student. •Calculate the best or highest score. •Then, Calculate letter grades based on the following criteria:...
in
java plz
amaining Time: 1 hour, 49 minutes, 15 seconds. Jestion Completion Status: Write a program that asks the user for an input file name, open, read ar number of students is not known. For each student there is a name and and display a letter grade for each student and the average test score fc • openFile: This method open and test the file, if file is not found and exit. Otherwise, return the opened file to the...
Write a program that asks the user to enter five test scores. The program should display a letter grade for each score and the average test score. Design the following functions in the program: calcAverage—This function should accept five test scores as arguments and return the average of the scores. determineGrade—This function should accept a test score as an argument and return a letter grade for the score (as a String), based on the following grading scale: Score Letter Grade...
Write a grading program in Java for a class with the following grading policies: There are three quizzes, each graded on the basis of 10 points. There is one midterm exam, graded on the basis of 100 points. There is one final exam, graded on the basis of 100 points. The final exam counts for 40% of the grade. The midterm counts for 35% of the grade. The three quizzes together count for a total of 25% of the grade....
Write a program that will calculate your letter grade at the end of the semester for CSIS130. Your program will read an input file that shall contain all the tests scores and lab scores for the semester, and the input file data should be in the following format: full name of student Test1 Score (0…100), Test2 Score (0..100) , Final Exam Score (0..100), Total Number of Labs: N NLab Scores (0=Fail, 1=Pass) [You will have N lab scores each separated...
Write a complete C++ program that reads students names and their test scores from an input text file. The program should output each student’s name followed by the test scores and the relevant grade in an output text file. It should also find and display on screen the highest/lowest test score and the name of the students having the highest/lowest test score, average and variance of all test scores. Student data obtained from the input text file should be stored...
Your assignment is to write a grade book for a teacher. The
teacher has a text file, which includes student's names, and
students test grades. There are four test scores for each student.
Here is an example of such a file:
Count: 5
Sally 78.0 84.0 79.0 86.0
Rachel 68.0 76.0 87.0 76.0
Melba 87.0 78.0 98.0 88.0
Grace 76.0 67.0 89.0 0.0
Lisa 68.0 76.0 65.0 87.0
The first line of the file will indicate the number of students...
using java
Program: Please read the complete prompt before going into coding. Write a program that handles the gradebook for the instructor. You must use a 2D array when storing the gradebook. The student ID as well as all grades should be of type int. To make the test process easy, generate the grade with random numbers. For this purpose, create a method that asks the user to enter how many students there are in the classroom. Then, in each...