14
answers
0
watching
327
views
22 Apr 2018
(c) Consider the following class: public class Student Grades private int ( grades; 1/loads values into grades from a file public void initializeFromFile(String filename) ....! //gets the total number of grades entered public int get NumRecords () (....) public class WebCT 1 public static void main(String[] args) Student Grades grades = new Student Grades(); grades.initializeFromFile("records. L.sv"); System.out.println("There are " + grades.length file.") " grades in that The goal of the program is to load the files and then print the total number of grades in the file. However, when you try to compile the above classes, you get the following error: WebCT.java:5: cannot find symbol symbol : variable length location: class Student Grades System.out.println("There are " + grades.length + " grades in that file." Explain why the crror occurs and write the code to fix it (while maintaining the intended functionality).
(c) Consider the following class: public class Student Grades private int ( grades; 1/loads values into grades from a file public void initializeFromFile(String filename) ....! //gets the total number of grades entered public int get NumRecords () (....) public class WebCT 1 public static void main(String[] args) Student Grades grades = new Student Grades(); grades.initializeFromFile("records. L.sv"); System.out.println("There are " + grades.length file.") " grades in that The goal of the program is to load the files and then print the total number of grades in the file. However, when you try to compile the above classes, you get the following error: WebCT.java:5: cannot find symbol symbol : variable length location: class Student Grades System.out.println("There are " + grades.length + " grades in that file." Explain why the crror occurs and write the code to fix it (while maintaining the intended functionality).
28 Jun 2023
Already have an account? Log in
marcusnicole284Lv10
16 Jun 2023
Already have an account? Log in
celluarsolLv10
7 Mar 2023
Already have an account? Log in
11 Feb 2023
Already have an account? Log in
papayaprofessorLv10
5 Sep 2022
Already have an account? Log in
Jarrod RobelLv2
23 Apr 2018
Already have an account? Log in