Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed 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 \begin{tabular}{|c|c|} \hline & \begin{tabular}{l} 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; \\ \} \\ \} \end{tabular} \\ \hline \end{tabular}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

How can you encourage creative problem solving by others?

Answered: 1 week ago

Question

Identify the cause of a performance problem. page 363

Answered: 1 week ago