Answered step by step
Verified Expert Solution
Link Copied!

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
3,
Lisa 100,95,80
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 x 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
\table[[Nane,Avg Grade],[Lisa,91.67],[A,]]
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 main(string[] args)
{
throws IoException
Scanner s= new Scanner(new File("gradebook.txt"));
//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
s.close();All Book68Home/Microsoft 365DebugStop. SaveAsubmit1235[6],[7]8911121314151516161718192021...Program finished with exit code 1Press ExrarR to exit console. []
image text in transcribed

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 Driven Web Sites

Authors: Mike Morrison, Joline Morrison

1st Edition

061901556X, 978-0619015565

More Books

Students also viewed these Databases questions

Question

2. Grade oral reports and class participation.

Answered: 1 week ago