Question
For all the labs this week, you will read the contents of a file and display the information on the screen in various ways. Download
For all the labs this week, you will read the contents of a file and display the information on the screen in various ways. Download the file Student Assignment Scores.csv Download Student Assignment Scores.csv. This file contains a list of students and the scores they received for 6 class assignments. Place this file in your PROJECT directory. Assume that your folder structure is similar to below.
eclipse-workspace -> CS105 -> src -> week10 -> StudentScores1
Then, you would place the \"Student Assignment Score\" file in your CS105 directory.
eclipse-workspace -> CS105
The format of the file looks like this:
Student, Asn 1, Asn 2, Asn 3, Asn 4, Asn 5, Asn 6
Kate Mulgrew, 92,98,91,96,97,99
Ethan.......
When submitting this lab, submit a .java file called StudentScores1, and create the following structure in Eclipse:
- Package Name:week10
- Class Name:StudentScores1
Write a program that uses a Scanner object to read from a file. Be sure that you instantiate the Scanner object inside of a try/catch statement but that the Scanner variable is visible outside of the try/catch scope. Using a while(xxxxxxx.hasNext()) structure, read each row of the file into a String variable. Print the String variable to the console.
Example Run
Student,Asn 1,Asn 2,Asn 3,Asn 4,Asn 5,Asn 6
Kate Mulgrew,92,98,91,96,97,99 Garrett Wang,86,0,89,78,0,99 Ethan Phillips,0,56,68,88,78,77 Jeri Ryan,100,98,100,100,100,100 Roxann Dawson,87,93,92,87,93,0 Robert Picardo,100,100,100,100,100,100 Robert Beltran,87,0,68,98,0,78 Robert McNeil,87,76,86,0,88,96 Tim Russ,97,96,98,99,100,98 Nana Visitor,98,76,85,88,78,96 Avery Brooks,98,96,94,99,82,96 Alex Siddig,78,86,95,87,76,88 Rene Auberjonois,89,88,98,94,89,96 Armin Shimerman,78,0,65,88,72,76 Terry Farrell,86,94,87,96,88,87 Jolene Blalock,98,99,97,96,99,100 Scott Bakula,97,98,100,96,100,100 Conner Trinneer,98,92,98,96,99,100 Dominic Keating,92,94,0,87,98,96 Linda Park,89,92,96,87,98,94 John Billings,0,98,0,0,99,0 Anthony Montgomery,78,86,74,65,63,75
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started