The correct journal entry to record manufacturing overhead applied to Job #40 is:
Work in process and credits Manufacturing overhead.
This is because when manufacturing overhead is applied to a specific job, it increases the Work in Process inventory (as the costs are associated with jobs being worked on) and decreases the Manufacturing Overhead account (which is a temporary account used to accumulate overhead costs until they are applied to jobs).