Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Database Systems A Practical Approach To Design Implementation And Management

Authors: THOMAS CONNOLLY

6th Edition

9353438918, 978-9353438913

More Books

Students also viewed these Databases questions

Question

=+Does it keep the visitor reading?

Answered: 1 week ago