A file named ClassData.txt contains records of several students. Each record contains student's name followed by four tests scores each score is out of 100. ClassData.txt Ali 80 89 95 75 Yusuf 77 85 89 98 Huda 74 75 72 71 Fatima 99 98 95 96 Write a Java program that reads the data from the file and calculate the average of the four test then program should print on the screen Student name with average greater than 60 ONLY.

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter9: Advanced Array Concepts
Section: Chapter Questions
Problem 3PE
icon
Related questions
Question

java

A file named ClassData.txt contains records of several students.
Each record contains student's name followed by four tests scores
each score is out of 100.
ClassData.txt
Ali 80 89 95 75
Yusuf 77 85 89 98
Huda 74 75 72 71
Fatima 99 98 95 96
Write a Java program that reads the data from the file and calculate the
average of the four test then program should print on the screen Student
name with average greater than 60 ONLY.
Transcribed Image Text:A file named ClassData.txt contains records of several students. Each record contains student's name followed by four tests scores each score is out of 100. ClassData.txt Ali 80 89 95 75 Yusuf 77 85 89 98 Huda 74 75 72 71 Fatima 99 98 95 96 Write a Java program that reads the data from the file and calculate the average of the four test then program should print on the screen Student name with average greater than 60 ONLY.
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Follow-up Questions
Read through expert solutions to related follow-up questions below.
Follow-up Question

java

A file named ClassData.txt contains records of several students.
Each record contains student's name followed by four tests scores
each score is out of 100.
ClassData.txt
Ali 80 89 95 75
Yusuf 77 85 89 98
Huda 74 75 72 71
Fatima 99 98 95 96
Write a Java program that reads the data from the file and calculate the
average of the four test then program should print on the screen Student
name with average greater than 60 ONLY.
Transcribed Image Text:A file named ClassData.txt contains records of several students. Each record contains student's name followed by four tests scores each score is out of 100. ClassData.txt Ali 80 89 95 75 Yusuf 77 85 89 98 Huda 74 75 72 71 Fatima 99 98 95 96 Write a Java program that reads the data from the file and calculate the average of the four test then program should print on the screen Student name with average greater than 60 ONLY.
IJ
File Edit View Navigate Code Refactor Build Run Iools VCS Window Help
untitled8 - file.java
untitled8
src C file
m main
file -
- G file.java
A ClassData X
v Funtitled8 C:\Users\3looy
Ģimport java.io.FileReader;
05 A 5
.idea
import java.util.*;
out
Aimport java.io.*;
V src
C file
public class file
E ClassData
A ClassData.txt.txt
6
{
public static void main(String args[])
7.
untitled8.iml
> uli External Libraries
{
8
PO Scratches and Consoles
Filereader file=new FileReader( fileName: "ClassData.txt");
9
10
11
BufferedReader bf=new BufferedReader(file);
12
13
String st=bf.readLine();
14
15
int sum=0;
16
17
int count=0;
18
19
double average=0;
20
21
while((st=bf.readLine())!=null)
22
23
{
24
25
StringTokenizer stn=new StringTokenizer(st);
26
String name=stn.nextToken ();
27
28
29
int phy=Integer.parseInt(stn.nextToken());
30
Build:
Build Output
v O untitled8: build failed At 4/28/2022 4:09 PM wit 1 sec, 51 ms C:\Users\3looy\IdeaProjects\untitled8\src\file.java:9:9
A file.java src 1 error
java: cannot find symbol
e cannot find symbol class Filereader :9
symbol:
class Filereader
location: class file
E TODO
O Problems
P Version Control
O Cannot resolve symbol 'Filereader
> Run
2 Terminal
K Build
1 Event Log
9:9 CRLF UTF-8 4 spaces 1
Transcribed Image Text:IJ File Edit View Navigate Code Refactor Build Run Iools VCS Window Help untitled8 - file.java untitled8 src C file m main file - - G file.java A ClassData X v Funtitled8 C:\Users\3looy Ģimport java.io.FileReader; 05 A 5 .idea import java.util.*; out Aimport java.io.*; V src C file public class file E ClassData A ClassData.txt.txt 6 { public static void main(String args[]) 7. untitled8.iml > uli External Libraries { 8 PO Scratches and Consoles Filereader file=new FileReader( fileName: "ClassData.txt"); 9 10 11 BufferedReader bf=new BufferedReader(file); 12 13 String st=bf.readLine(); 14 15 int sum=0; 16 17 int count=0; 18 19 double average=0; 20 21 while((st=bf.readLine())!=null) 22 23 { 24 25 StringTokenizer stn=new StringTokenizer(st); 26 String name=stn.nextToken (); 27 28 29 int phy=Integer.parseInt(stn.nextToken()); 30 Build: Build Output v O untitled8: build failed At 4/28/2022 4:09 PM wit 1 sec, 51 ms C:\Users\3looy\IdeaProjects\untitled8\src\file.java:9:9 A file.java src 1 error java: cannot find symbol e cannot find symbol class Filereader :9 symbol: class Filereader location: class file E TODO O Problems P Version Control O Cannot resolve symbol 'Filereader > Run 2 Terminal K Build 1 Event Log 9:9 CRLF UTF-8 4 spaces 1
Solution
Bartleby Expert
SEE SOLUTION
Knowledge Booster
File Input and Output Operations
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning