Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a program that reads a file named gradebook.txt containing information about a student's grade. The information include the first name and three exam
Write a program that reads a file named "gradebook.txt containing information about a student's grade. The information include the first name and three exam scores.
File Format
The first line contains the number of exams.
The second line contains the name, and the exam scores.
Sample input file
Lisa
You will need to create a new file in onlinegdb and name it "gradebook.txt There's a file icon on the top left of the code editor. Click on this icon to create a new file. If you do not see this icon, it's because a red ribbon with the message that you haven't confirmed your email is blocking it Click the on the red ribbon to the far right.
The output of the program is a table consisting of a name column, average, and grade column. The grade column is optional.
Sample run
tableNaneAvg GradeLisaA
Here's the logic to solving the problem:
Read the number of exams
Read the name
Read the three exams using a loop and compute the total
Compute the average
Compute the letter grade.
Print the name, average, and letter grade.
Draft version
L
hat
Rum
Mainjava
import
java.io ;
import java.util.";
class Main
public static void mainstring args
throws IoException
Scanner new Scannernew Filegradebooktxt;
Read the number of exans
Read the name
Read the exam scores and campute the fotal
Compute the average
compute letter grade
print name, average, and letter grade
sclose;All BookHomeMicrosoft DebugStop SaveAsubmitProgram finished with exit code Press ExrarR to exit console.
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