Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Something is wrong with my code and i need help. pics below (sorry if not in order) NP 1 import java, io.BufferedReader 2 import java.io.File;

Something is wrong with my code and i need help. pics below (sorry if not in order)
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
NP 1 import java, io.BufferedReader 2 import java.io.File; 3 import java.io.FileReaderi 4 import java.io.Filewriteri 5 import java.util.Scanner: 6 7 public class LabProgram 8 9 public static void main(String[] args) { 10 Scanner scanner = new Scanner(Systen.in); 11 String inputFilePath = scanner.next(); 12 String outputFilePath = "report.txt"; 13 try { 14 File file = new File( inputFilePath); 15 FileReader fr = new FileReader(file); 16 BufferedReader br = new BufferedReader(fr); 17 String Line = "" 18 String grade - ""; 19 double totalStudentsCount = ; 20 int midisum = @; 21 int mid2Sum=; 22 int finalsum = 0; 23 24 Filewriter writer = new Filewriter(output FilePath, false); 25 while ((line = br.readLine()) != null) { 26 String(LineArr = line.split(","); 27 String lastllame - LineArr(0); 28 String firstName = lineArr(1): 29 int midiscore - Integer.parseInt(lineArr(2]); 30 int mid2Score - Integer.parseInt(lineArr(3]); 31 int finalscore = Integer.parseInt(lineArr(41); 32 double averageScore - (midiscorernid2Score-finalScore)/3; 33 midim midi rore. PROBLEMSA OLED double averageScore = (midlScore-mid2Score+finalscore)/3; midisum += midiscore; mid2Sum += mid2Score; finalsum += finalScore; 5 7 18 39 40 41 A2 if (averageScore >= 90) { grade = "A"; } else if (averageScore >= 80 & averageScore = 70 && averageScore = 68 && averageScore 60 l averagescore 54 55 double dla nidisun)/totalStudentsCount: 56 double dag - (nid2Sum)/totalStudents Count; 37 double finalava = (finalsund/totalStudentsCount: 58 59 writer.write(" "); 60 writer.write("Averages: Mad 1 4String.format("6.2t", midsavg)**, Mid 2 eString.format(".26, nadzAvg)+", Final String.format("%.2f", fine 61 62 writer.close(): 63 64 System.out.println("Report generated successfully'); 65 } catch (Exceptions 66 e.printStackTrace(): 07 68 > 69 Coding trail of your work What is this? 1/20 R0,0,00 min: 11 Latest submission - 9:21 PM EST on 01/20/22 Total score: 0/10 Only show failing tests Download this submission Come output 0/4 avalang.Netayinde otomation Index of bounds for length 1 At Loh Program Pro Sava) Inou Student into Your content your program produced output BOLAN CHE CSI 71 Expected to content TY licenda WA M... Mina 2. Compare tout Savan. Netayin debutbud andeki powlanes at Lanta Program Indo decinta Your le content your program produced a cutout betyle tud

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

Object Oriented Databases Prentice Hall International Series In Computer Science

Authors: John G. Hughes

1st Edition

0136298745, 978-0136298748

More Books

Students also viewed these Databases questions