Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Expert Oracle9i Database Administration

Authors: Sam R. Alapati

1st Edition

1590590228, 978-1590590225

More Books

Students also viewed these Databases questions