Write method for searching the grade of the student whose ID is given.

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

FOR JAVA, JUST FILL THIS CODE ABOUT THE QUESTIONS BELOW IT IN 50 MINUTES PLEASE. !!!

import java.util.ArrayList;
 
public class University {
 
}
 
// SERVER-SIDE
class ServerTeacher {
 
// port:     the port number to be allocated
// students: list of the students having id and grade information 
private int port;
private ArrayList<Student> students;
 
public ServerTeacher(int port, ArrayList<Student> students) {
this.port = port;
this.students = students;
}
 
// find the grade of the student whose id given, if student couldn't find then return -1
public int findGrade(int id) {
 
// *** FILL THIS METHOD FOR PART 1 *** //
 
}
 
// open the server listen for the student ask their grades
public int respondStudent() {
 
// *** FILL THIS METHOD FOR PART 2 *** //
 
}
}
 
// CLIENT-SIDE
class ClientStudent {
 
private int port; // the port number to be allocated
 
public ClientStudent(int port) {
this.port = port;
}
 
// open client and ask the student's grade to server
public void requestGrade(int id) {
 
// *** FILL THIS METHOD FOR PART 3 *** //
 
}
 
}
 
 
// STUDENT OBJECT
class Student {
private int id;
private int grade;
 
public Student(int id, int grade) {
this.id = id;
this.grade = grade;
}
 
public int getId() {
return id;
}
public int getGrade() {
return grade;
}
public void setId(int id) {
this.id = id;
}
public void setGrade(int grade) {
this.grade = grade;
}
}
*****************************************************************

Write a Server-Client application that Server provides grade information of students while the Client asks the grade of the student whose ID is given.

Part I 

Write method for searching the grade of the student whose ID is given.

Part II 

Write Server side class for waiting students to ask their grade and responding their grades.

Part III 

Write Client side class for asking grades of the students.

Expert Solution
steps

Step by step

Solved in 2 steps

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