for the class Student that contains 3 attributes: name, studentNumber and course. You are to provide the setter and getter methods as well as the body of the constructor that has a missing body. You are also required to provide an implementation to the method showStudentInformation() so that once it is called it should display the name, stud
Student.java
/*
Given the partial code for the class Student that contains 3 attributes: name, studentNumber and course.
You are to provide the setter and getter methods as well as the body of the constructor that has a missing body.
You are also required to provide an implementation to the method showStudentInformation() so that once it is
called it should display the name, studentNumber and course of the Student object.
*/
public class Student
{
private String name;
private int studentNumber;
private String course;
// this is constructor #1 - no need to add anything here
public Student()
{}
// this is constructor #2 - you have to provide the body of this constructor
public Student(String name, int studentNumber, String course)
{
// complete the body of this constructor
}
// put your setters here
// put your getters here
public void showStudentInformation()
{
// this method should display the name, studentNumber and the course of the student object.
}
}
TestStudent.java
// Module 2 Assignment
public class TestStudent
{
public static void main(String args[])
{
Student s1 = new Student("Lawrence", 1111, "BS Computer Science");
Student s2 = new Student();
Student s3 = new Student();
// set the properties of Student s2, assign a name, studentNumber and course
// set the properties of Student s3, assign a name, studentNumber and course
// print the identity of Student s1
s1.showStudentInformation();
// print the identity of Student s2 by calling the getter methods
// print the identity of Student s3 by calling the showStudentInformation() method
}
}
![The picture file (link) below contains code for classes Student and TestStudent
Student.java
TestStudent.java
The code is incomplete. Complete the code by following the instructions written as comment in the program lines.
1. In Student java, you need to provide the following:
- constructor
- getters and setters
- body of the showStudentinformation() method
2. In TestStudent, you need to provide the following:
- properties/attributes value of studen 2 and student 3
- printing the information of all the students](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F3d86cbad-5810-4e17-a404-b0d554b40ea0%2F88379801-be99-4aa8-9cdb-788b17231bc5%2Fhy0duaq_processed.jpeg&w=3840&q=75)
![](/static/compass_v2/shared-icons/check-mark.png)
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 3 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
![Concepts of Database Management](https://www.bartleby.com/isbn_cover_images/9781337093422/9781337093422_smallCoverImage.gif)
![Prelude to Programming](https://www.bartleby.com/isbn_cover_images/9780133750423/9780133750423_smallCoverImage.jpg)
![Sc Business Data Communications and Networking, T…](https://www.bartleby.com/isbn_cover_images/9781119368830/9781119368830_smallCoverImage.gif)