Question
This is a Java project- For this project, create a Student class with these variables as its data members (aka properties, attributes, instances variables) along
This is a Java project-
For this project, create a Student class with these variables as its data members (aka properties, attributes, instances variables) along with setter and getter methods for them plus a toString method for producing a nicely formatted view of an objects state.
This program will perform all the actions of the previous one with two key differences: it will put the values it reads from the file into the data members of a Student object then add each object to either an ArrayList or a LinkedList of Students (your choice). It will produce its output by looping through the ArrayList or LinkedList using an extended for statement.
Process this data as before:
Calculate the average score for the group Determine whether a particular score is greater than, equal to or less than the average Derive a letter grade for each numeric score Calculate the standard deviation of the group of scores
This time, well maintain only a list of Student object in memory instead of separate ArrayLists of individual varaibles.
The rules for deriving a letter grade are:
Numeric grade >= 90, A Numeric grade >= 80 and < 90, B Numeric grade >= 70 and < 80, C Numeric grade >= 60 and < 70, D Numeric grade, 60, F
Of course you know how to express these rules in code without using compound conditions, right?
Calculating a standard deviation:
Calculate the average for the group Subtract the average from each score (Score - Average) and raise it to the second power (Score - Average)^2 Sum the previous values of (Score - Average)^2 Divide this sum by the number of scores minus 1 Take the square root of the previous value
See the example below:
Student Score Score - Average (Score - Average)^2 Roth, Philip 80 3.5 12.25 McCall-Smith, Alexander 75 -1.5 2.25 Baldacci, David 70 -6.5 42.25 Garcia Marquez, Gabriel 90 13.5 182.25 Grisham, John 75 -1.5 2.25 DeLillo, Don 85 8.5 72.25 Borges, Jorge 95 18.5 342.25 Patterson, John 70 -6.5 42.25 Sparks, Nicolas 60 -16.5 272.25 Brown, Dan 65 -11.5 132.25
Sum 765 1102.5
Average 76.5
Count - 1 9
Sum((Score - Average)^2)/(Count - 1) 122.5
=SqRoot( 122.5 ) 11.06797
Check using Excel's stdev function 11.06797
Sample output: Group average: 76.5 Standard deviation: 11.06797
Relative to Letter Student Score Average Grade
Roth, Philip 80 > Average B McCall-Smith, Alexander 75 < Average C Baldacci, David 70 < Average C
Youll probably need to use System.out.printf to produce well-aligned output.
________________________________________________________________
Below is the .txt file contents.
1000 Roth, Philip 80 2000 McCall-Smith, Alexander 75 3000 Baldacci, David 70 4000 Garcia Marquez, Gabriel 90 5000 Grisham, John 75 6000 DeLillo, Don 85 7000 Borges, Jorge 95 8000 Patterson, John 70 9000 Sparks, Nicolas 60 10000 Brown, Dan 65
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