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

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

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
Transcribed Image Text: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
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 3 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY