Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Code Fragment-1:1 ); while(t input.equals(ext ) Scanner src = new Scanner(System.in): System.out.println(Would you like to test the Car emission amount input src.next(): if(input.hasNext() && input.equals(yes))
Code Fragment-1:1 ); while(t input.equals("ext ) Scanner src = new Scanner(System.in): System.out.println("Would you like to test the Car emission amount input src.next(): if(input.hasNext() && input.equals("yes")) { em 15sionAmount car.testEmissions() System.out.println(tests -- Car Emissions: entssionAmount: emissionAmount : ON System.out.println("Would you like to test the Truck emission amount: input src.next(): 17 input.hasNext() 86 input.equals("yes")) { emission Andunt truck.testEmissions : System.out.println(tests --Truck Emissions : emissionAmount); emissionAmount = ): System.out.println("Would you like to test the Motorcycle emission amount : input = src.next(): if(input.hasNext() 66 input.equals("yes")) { emission Amount = motorcycle.testEmissions System.out.println(tests -- Motorcycle Emissions: emission Amount: emission Amount : System.out.println("Would you like to test the Semi Truck emission amount: "); input Src.next(): it (input.hasNext() 6 input.equals("yes")) { emissionAmount = Semi Truck. testeissions : System.out.println(tests Semi Truck Emissions emission Amount) emissionAmount = 0; System.out.println("Would you like to test the car emission amount Input Src.next(): if(input.hasNext() && input.equals("yes")) { emissionAmount van. testEmissions() System.out.println(tests -- Van Emissions emission Amount: emissionAmount = Part a (5 pts): Select a Code Smell: 1. Duplicate Codel 2. Long Parameter 3. Large Classi 4. All of the above! Part b (5 pts): Select the violation of design fundamental design principles which is most responsible for the above smell: 1. Separation of Concern! 2. Abstraction 3. Information Hiding 4. None of the Above
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started