This example shows how a Spring Boot controller method returns different HTTP status codes based on input. The method uses a switch statement on the input code. For 200, it returns ResponseEntity.ok with message "OK". For 404, it returns status 404 with "Not Found". For 500, it returns status 500 with "Server Error". For any other code, it returns 400 Bad Request with "Invalid code". The execution table traces each input and the response status and body returned. The variable tracker shows how the input code and response values change step by step. Key moments clarify why different codes are returned and what happens on unknown codes. The quiz tests understanding of which status and body correspond to which input code. This helps beginners see how to control HTTP responses clearly in Spring Boot.