trouble with HC-SR04 and 5V DC motor

you're saying the code is totally wrong? Where can i find a good code?