Let the number Dennis thought be x.
He adds 0.5 to that number and then multiplies the new result by 4.
The new number now is 4(x+0.5) He then subtracts 2 and divides the number by 2.The new number formed is

Given His final answer is 48.
We can form an equation in x.

To solve for x we multiply both sides by 2 to get
4(x+0.5)=96
4x+2=96
Subtracting 2 both sides
4x=94
Dividing both sides by 4:
x=24.
The number Dennis thought is 24.