Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Need help for make up my java code. thank you! use this code: import java.io.FileNotFoundexception; import java.util.ArrayList; import java.util.Scanner; public class HW1 { public static

Need help for make up my java code. thank you!

use this code:

import java.io.FileNotFoundexception;

import java.util.ArrayList;

import java.util.Scanner;

public class HW1 {

public static void main (String[] args) {

File file = new File("HW1_STudents.txt");

ArrayList studentNums = new ArrayList() ;

ArrayList studentNames = new ArrayList() ;

ArrayList studentGrades = new ArrayList() ;

try {

Scanner scanner = new Scanner(flie);

String studentNumStr = scanner.nextLine();

int studentNum = Integer.parseInt(studentNumStr) ;

studentNums.add(studentNum) ;

String studentName = scanner .nextLine();

String studentGradeStr = scanner .nextLine();

double studentGrade = Double .parseDouble(studentGradeStr);

scanner .close();

catch (FileNotFoundException e) {

// TODO Auto-generated catch block

e.printStackTrace();

}

}

}

}

image text in transcribedimage text in transcribed

need help for java code and run completely(with comment)

thanks!

Review of Basics: Control Statements, Repetition, ArrayLists, Methods and Text File IO Write a program to read student data from a text file which is attached to the drop box as This file is in the format: Student ID (int) Full name (last, first) (String) Test score (double) We need to process this data: - Read data from the file. *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 Display output as shown in the sample below. - * * Because of this, we'll need to maintain lists of data in memory. We could use arrays of IDs, names, scores, etc.; however, the trend is to use more flexible structures like ArrayLists, Vectors or Linkedlists because, unlike fixed size arrays, they can expand to hold more data as needed. The rules for deriving a letter grade are: Numeric grade >= 90, " Numeric grade >- 80 and - 70 and - 60 and Average

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

Database Design And Relational Theory Normal Forms And All That Jazz

Authors: Chris Date

1st Edition

1449328016, 978-1449328016

More Books

Students also viewed these Databases questions

Question

Methods of Delivery Guidelines for

Answered: 1 week ago