Skip to content
free
K
1
2
practice
Home
Math
English
Science
Social Studies
Contact
Language
English
Español
Sign In
/
High School Electives
/
Computer Science
/
Algorithm Decomposition and Modules
Grade Level
Computer Science
HSCS.099 Algorithm Decomposition and Modules
0%
Skill Level
🔴 Hard
00:00
Progress to Next Level
25% to Medium
Easy
Medium
Hard
Mastery
100%
A logging statement is copied into dozens of algorithm functions, and changing the log format breaks tests across the project. Which refactor best reduces coupling?
A
Create a logging service interface and have modules call that interface instead of formatting logs themselves.
B
Use a global logText variable that every function appends to directly.
C
Put algorithm calculations inside the logging service so every result is logged automatically.
D
Keep copied logging statements because each function knows its own message best.
Submit Answer