Ask about programs

Hello sir,good afternoon
I have a task from my teacher how to connect Ultrasonic Sensor with Motor Driver and i try like this

// Ultrasonic - Library for HR-SC04 Ultrasonic Ranging Module.
// Rev.4 (06/2012)
// J.Rodrigo ( www.jrodrigo.net )
// more info at www.ardublog.com

#include <Ultrasonic.h>

Ultrasonic ultrasonic(9,8); // (Trig PIN,Echo PIN)
int A=2;
int B=3;

void setup() {
Serial.begin(9600);
digitalWrite(2,OUTPUT);
digitalWrite(3,OUTPUT);
}

void loop()
{
if (Ultrasonic >= 10){
digitalWrite(2,HIGH);
digitalWrite(3,HIGH);
}
else (Ultrasonic <= 10){
digitalWrite(2,LOW);
digitalWrite(3,LOW);
}
Serial.print(ultrasonic.Ranging(CM)); // CM or INC
Serial.println(" cm" );
delay(100);
}

but it got fail,how to solve this?
thanks in advance
(Sorry for bad grammar XD)

if (Ultrasonic >= 10){ Right there?
Ultrasonic is a class. You can't compare it to a number.
You need to call one of the class methods of the object "ultrasonic"

Please remember to use code tags when posting code

I'm going to guess that lines like these:

if (Ultrasonic >= 10.....

... should look more like this:

Serial.print(ultrasonic.Ranging(CM)); // CM or INC

So like this perhaps:

if (ultrasonic.Ranging(CM)>= 10....

BTW, your teacher should be explaining this stuff to you - it's what they're paid for.