Question: Java Write a program that reads in lines from standard input, StdIn , with each line containing a name and three test scores, and then

Java

Write a program that reads in lines from standard input, StdIn, with each line containing a name and three test scores, and then uses the printf() method in StdOut to print a table with a column for the names and the three scores followed by the average of the scores. The scores should be accurate to three decimal places. You could use a program like this to tabulate batting, averages for baseball players or grades for students.

To access the StdOut class and other classes in algs4.jar Download algs4.jar, you will need to do the following:

Download the algs4.jar Download algs4.jarfile to a folder. The folder should be dedicated to Java libraries for this course

To add algs4.jar to your VS Code project:

In your VS Code window, go to Java Project, then Referenced Library and select algs4.jar from the folder where you placed it.

In your Java program add the import statements as shown below:

import edu.princeton.cs.algs4.StdOut;

Do NOT use System.out.println() to output your results.

Please comment what each part does.

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!