Question: solve this question asap ! Q4. Consider the following code snippet. [CO5] a. Identify at least 3 code smells from the below code and name

solve this question asap !
Q4. Consider the following code snippet. [CO5] a. Identify at least 3 code smells from the below code and name them. [3] b. Refractor the source code to remove 4 different Code smells( write the code segment in your copy which has code smell and then show the correct way to refactor it). [4.5] NB: The "System.out.println" statements should not cause any smells public abstract class Education\{ public void provideQualityEducation(); public void takeClasses(); public void checkExamScripts(); \} public class Student extends Education\{ public String studentName; public String studentld; public String department; public String enrollmentDate; public int totalCreditCompleted; public double currentCGPA; public String semester; public String InternationalPolitics = "no polictics"; public void setStudentDetails(String studentName, String studentld, String department, String enrollmentDate, double totalCreditCompleted, double currentCGPA, String semester) \{ this.studentNam = studentName; this.studentld = studentld; this. department = department; this.enrollmentDate = enrollmentDate; this . totalCreditCompleted = totalCreditCompleted; this.currentCGPA = currentCGPA; this.semester = semester; \} //below method is for showing student Details public void meritBasedScholarship() \{ collectStudentsInformation(); getStudentsSemesterDetails(); System.out.printIn("Student Name: " + this.x); System.out.printIn("Student ID: " + this.studentId); System.out.printIn("Department: " + this.y); System.out.printIn("Enrollment Date: " + this.z); \} \} public class Teacher \{ public String teacherName; public String teacherID;; public String InternationalPolitics = "n politics"; public void setTeacherDetails (String teacherName, String teacherID) \{ this.teacherName = teacherName; this.teacherName = teacherID; \} \}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
