Great Deal! Get Instant $10 FREE in Account on First Order + 10% Cashback on Every Order Order Now

his homework is included in your final grade and is scored out of 8 points . Instructions: Complete 12.30 and the following problem Students.java The file students.txt has the following format on...

1 answer below »

his homework isincluded in your final gradeand is scored out of8 points.

Instructions:

Complete 12.30 and the following problem

Students.java

The file students.txt has the following format on each line

fname(string) lname(string) credits(int) GPA(float) with a single space between each field.

For example

Mitchell Beck XXXXXXXXXX
Thelma Colon XXXXXXXXXX
Erma Mullins XXXXXXXXXX
Pedro Mack XXXXXXXXXX

A freshman has 0-29 credits, a sophamore has 30-59, a junior has 60-89 and a senior has 90+ credits. Write a program to open the file and read all the contents. Report back to the user the number of freshmen, sophomores, juniors and seniors. Output the first and last names of the person with the highest GPA for each of those categories.

Grading criteria

12.30 Letter Occurences

0.5 Prompt and read file name

1.0 Read file and process character data

0.5 Report A-Z frequencies

1.0 Form

1.0 Documentation

Students.java

1.0 Read data from file

0.5 Count and report number for each year

0.5 Report highest GPA for each year

1.0 Form

1.0 Documentation

Files:

students.txt(.txt, 2K)

Sample data file

Below is the data file

Mitchell Beck XXXXXXXXXX

Thelma Colon XXXXXXXXXX

Erma Mullins XXXXXXXXXX

Pedro Mack XXXXXXXXXX

Stella Diaz XXXXXXXXXX

Mona Conner XXXXXXXXXX

Gilbert Kim XXXXXXXXXX

Renee Miles XXXXXXXXXX

Cesar Warner XXXXXXXXXX

Krystal Pittman XXXXXXXXXX

Lonnie Evans XXXXXXXXXX

Lorene Murray XXXXXXXXXX

Gabriel Burgess XXXXXXXXXX

Timothy Pratt XXXXXXXXXX

Joseph Cummings XXXXXXXXXX

Lori Barrett XXXXXXXXXX

Salvador Simmons XXXXXXXXXX

Isabel Russell XXXXXXXXXX

Lawrence Swanson 9 0.67

Tracy Jennings XXXXXXXXXX

Lowell Wagner XXXXXXXXXX

Jackie Stanley XXXXXXXXXX

Joann Summers XXXXXXXXXX

Sally Bell XXXXXXXXXX

Robyn Ruiz XXXXXXXXXX

Misty Blake XXXXXXXXXX

Austin Morrison XXXXXXXXXX

Phillip Aguilar XXXXXXXXXX

Ana Burke XXXXXXXXXX

Rosa Ballard XXXXXXXXXX

Rachael Owens XXXXXXXXXX

Elmer Watson XXXXXXXXXX

Erica Horton XXXXXXXXXX

Rose Fernandez XXXXXXXXXX

Gregg Hubbard XXXXXXXXXX

Mathew Reyes XXXXXXXXXX

Winston Underwood XXXXXXXXXX

Scott Austin XXXXXXXXXX

Nettie Bryant XXXXXXXXXX

Brent Bass XXXXXXXXXX

Elias Hogan 5 0.13

Alyssa Collins XXXXXXXXXX

Kristen Ellis XXXXXXXXXX

Gerardo Williams XXXXXXXXXX

Van Reynolds XXXXXXXXXX

Tommie Doyle XXXXXXXXXX

Stacy Soto XXXXXXXXXX

Nancy Parker XXXXXXXXXX

Colleen Grant XXXXXXXXXX

Melvin Simpson XXXXXXXXXX

Janet Bowers XXXXXXXXXX

Frederick Lucas XXXXXXXXXX

Kristopher Garcia XXXXXXXXXX

Kayla Sherman XXXXXXXXXX

Matthew Mclaughlin XXXXXXXXXX

Kerry Howell XXXXXXXXXX

Monica Franklin XXXXXXXXXX

Hazel Dawson XXXXXXXXXX

Eleanor French XXXXXXXXXX

Diana Carlson XXXXXXXXXX

John Silva XXXXXXXXXX

Cody Taylor XXXXXXXXXX

Paula Wheeler XXXXXXXXXX

Eunice Higgins XXXXXXXXXX

Evan Reed XXXXXXXXXX

Robin Fuller XXXXXXXXXX

Yvette Norton 0 2.53

Lee Rice XXXXXXXXXX

Casey Blair XXXXXXXXXX

Alberto Willis XXXXXXXXXX

Dixie Hicks XXXXXXXXXX

Alfred Dennis XXXXXXXXXX

Debra Chavez XXXXXXXXXX

Joy Robertson XXXXXXXXXX

Kerry Bridges XXXXXXXXXX

Spencer Baldwin XXXXXXXXXX

Dana Curry XXXXXXXXXX

Josephine Wood 4 3.37

Whitney Andrews XXXXXXXXXX

Rudolph Hoffman XXXXXXXXXX

Edith Massey XXXXXXXXXX

Jamie Hawkins XXXXXXXXXX

Ernestine Daniel XXXXXXXXXX

Bill Cross XXXXXXXXXX

Norma Hayes XXXXXXXXXX

Jermaine Thornton XXXXXXXXXX

Sherry Wilkins XXXXXXXXXX

Floyd Gill XXXXXXXXXX

Jacob Medina XXXXXXXXXX

Sue Kelly XXXXXXXXXX

Cecilia Mckenzie XXXXXXXXXX

Boyd Benson XXXXXXXXXX

Anna Lambert XXXXXXXXXX

Alton Holt XXXXXXXXXX

Ricardo Kelley XXXXXXXXXX

Daisy Guerrero XXXXXXXXXX

Melissa Gray XXXXXXXXXX

Alex Wilkerson XXXXXXXXXX

Karl Moran XXXXXXXXXX

Curtis Hampton XXXXXXXXXX

Exercise 12.30

Answered Same Day Sep 21, 2021

Solution

Aditya answered on Sep 22 2021
156 Votes
Final/CountLette
package countletter;
import java.io.*;
import java.util.Map;
import java.util.Scanner;
import java.util.TreeMap;
import java.*;
public class CountLetter{
public static void main(String agrs[]) throws IOException
{
char[] alphabets = {'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'};
int[] counts ={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
int ch = 0;
File file = new File("d:\\output.txt");
FileReader fr = new FileReader(file);
BufferedReader
= new BufferedReader(fr);
while ((ch =
.read()) != -1)
{
char character = Character.toUpperCase((char)ch);
for(int i = 0;i<26;i++)
{
if(character==alphabets[i])
{
counts[i] = counts[i]+1;

eak;
}
}
}

.close();
for(int j =0;j<26;j++){
System.out.println("Number of "+alphabets[j]+"s "+counts[j]);
}
...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here