
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Question
thumb_up100%
![Which of the following Student class methods must be implemented in the Student class to make this main method successfully display from the array each student's lastName, firstName and totalPoints?
public static void main (String[] args)
{
}
Student [] my_class = { new Student ("smith","fred", 95),
new Student ("bauer", "jack",123),
new Student ("jacobs","carrie", 195),
new Student ("renquist", "abe",148),
new Student ("3ackson","trevor", 108),
new Student ("perry","fred",225),
new Student ("loceff","fred", 44),
new Student("stollings", "pamela",452),
new Student ("charters", "rodney", 295),
new Student ("cassar","john", 321),
};
for (int k = 0; k<data.length; k++)
System.out.println( data[k] );
O printArrayConsole Method:
public static void printArrayConsole(String title, Student[] data)
{
}
O Default Constructor:
}
System.out.println("\n********** " + title + " **********\n");
for (int k = 0; k < data.length; k++)
System.out.println(data[k].toString() );
public Student ( )
lastName = firstName = "zz-error";
totalPoints = 0;
System.out.println();
O Parameterized constructor:
}
public Student ( String 1st, String fst, long pts)
lastName = firstName = "zz-error";
totalPoints = 0;
ⒸtoString method
}
public String toString()
{
String strStudent = lastName + ", " + firstName
+ " Points: " + totalPoints;
return strStudent;](https://content.bartleby.com/qna-images/question/cb2584b9-3c16-410b-8e35-749ba9c43d09/6803d49f-bff5-4f5a-af7d-0a579934f985/odcyh2h_thumbnail.png)
Transcribed Image Text:Which of the following Student class methods must be implemented in the Student class to make this main method successfully display from the array each student's lastName, firstName and totalPoints?
public static void main (String[] args)
{
}
Student [] my_class = { new Student ("smith","fred", 95),
new Student ("bauer", "jack",123),
new Student ("jacobs","carrie", 195),
new Student ("renquist", "abe",148),
new Student ("3ackson","trevor", 108),
new Student ("perry","fred",225),
new Student ("loceff","fred", 44),
new Student("stollings", "pamela",452),
new Student ("charters", "rodney", 295),
new Student ("cassar","john", 321),
};
for (int k = 0; k<data.length; k++)
System.out.println( data[k] );
O printArrayConsole Method:
public static void printArrayConsole(String title, Student[] data)
{
}
O Default Constructor:
}
System.out.println("\n********** " + title + " **********\n");
for (int k = 0; k < data.length; k++)
System.out.println(data[k].toString() );
public Student ( )
lastName = firstName = "zz-error";
totalPoints = 0;
System.out.println();
O Parameterized constructor:
}
public Student ( String 1st, String fst, long pts)
lastName = firstName = "zz-error";
totalPoints = 0;
ⒸtoString method
}
public String toString()
{
String strStudent = lastName + ", " + firstName
+ " Points: " + totalPoints;
return strStudent;
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by stepSolved in 5 steps

Knowledge Booster
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
- Complete the Kennel class by implementing the following methods: addDog(Dog dog) findYoungestDog() method, which returns the Dog object with the lowest age in the kennel. Assume that no two dogs have the same age. Given classes: Class LabProgram contains the main method for testing the program. Class Kennel represents a kennel, which contains an array of Dog objects as a dog list. (Type your code in here.) Class Dog represents a dog, which has three fields: name, breed, and age. (Hint: getAge() returns a dog's age.) For testing purposes, different dog values will be used. Ex. For the following dogs: Rex Labrador 3.5 Fido Healer 2.0 Snoopy Beagle 3.2 Benji Spaniel 3.9 the output is: Youngest Dog: Fido (Healer) (Age: 2.0)arrow_forwardQuèstion 17 when an individual array element of an array of type int is passed to a method, it is passed by reference. True Falsearrow_forwardJAVA PROGRAM Chapter 7. PC #1. Rainfall Class Write a RainFall class that stores the total rainfall for each of 12 months into an array of doubles. The program should have methods that return the following: • the total rainfall for the year • the average monthly rainfall • the month with the most rain • the month with the least rain Demonstrate the class in a complete program. Main class name: RainFall (no package name) HERE IS A WORKING CODE, PLEASE MODIFY THIS CODE SO THE PUBLIC CLASS IS MAIN AND WERE EVER THERE IS MAIN IN THE CHANGE IT SO IT RUNS. ALSO, MAKE SURE WHEN I UPLOAD THE CODE TO HYPERGRADE IT PASSES ALL THE TEST CASES. THANK YOU import java.util.Scanner;public class Main { private double[] rainfall = new double[12]; public Main(double[] rainfall) { this.rainfall = rainfall; } public double getTotalRainfall() { double total = 0.0; for(double rain : rainfall) { total += rain; }…arrow_forward
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education

Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON

Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education