Question: import java.util.*; public class StudentGrade { public static void main(String []args) { double test1, test2, test3, test4, test5; double average; String firstName; String lastName; Scanner

import java.util.*; public class StudentGrade { public static void main(String []args) { double test1, test2, test3, test4, test5; double average; String firstName; String lastName; Scanner inFile = new Scanner("test.txt"); PrintWriter outFile = new PrintWriter ("testavg.out"); firstName = inFile.next(); lastName = inFile.next(); outFile.println("Student name:" + firstName + "" + lastName); test1 = inFile.nextDouble(); test2 = inFile.nextDouble(); test3 = inFile.nextDouble(); test4 = inFile.nextDouble(); test5 = inFile.nextDouble(); outFile.printf("Test scores: %6.2f %6.2f %6.2f " + "%6.2f %6.2f %n", test1, test2, test3, test4, test5); average = (test1 + test2 +test3 + test4 + test5) /5.0; outFile.printf("Average test score: %6.2f %n", average ); inFile.close(); outFile.close(); } }

can you make this code run in java please

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!