ADXL345 accelerometer error

I have an accelerometer connected to an Arduino Uno board. but showing me an error

#include <SoftwareSerial.h>

float distance = 0;
unsigned long startTime;
void setup()
{
//....
Serial.begin(9600);
startTime = millis(); // will store time of first execution of program.
}

void loop()
{

float x = getX(); // save data of 3 axis from ADXL345(first you have to be able to get data from ADXL345)
float y = getY();
float z = getZ();

float accel = sqrt(x * x + y * y + z * z); // add as a vector to get cummulative acceleration.
unsigned long currentTime = millis();

//caculating distance using distance formula

distance = 0.5 * accel * (currentTime - startTime) * (currentTime - startTime) / 1e6; // 1e6 is correction to convert millis to seconds
startTime = currentTime; // remember time for next cycle

Serial.println(distance, 5); // displaying distance calculated
}

/Users/ahmedalbuainin/Documents/Arduino/ADXL345/ADXL345.ino: In function 'void loop()':
ADXL345:16: error: 'getX' was not declared in this scope
float x = getX(); // save data of 3 axis from ADXL345(first you have to be able to get data from ADXL345)
^
ADXL345:17: error: 'getY' was not declared in this scope
float y = getY();
^
ADXL345:18: error: 'getZ' was not declared in this scope
float z = getZ();
^
exit status 1
'getX' was not declared in this scope

ADXL345.ino (821 Bytes)

Please read the "How to use this forum" post and follow the directions. Post your code properly.

As the error message suggests, you will need to supply code for the functions getX() etc.

thank you for your response
But how do I write a supply code function for getX()?

In the best of all worlds, you would learn how the accelerometer works and write code that tells it to send you the data.

However, this is an extremely popular accelerometer and tens of thousands of Arduino enthusiasts have used it.

Did it never occur to you that Google might find some examples?

recently I did a lot of research but I did get any useful info:sob:
please, could you explain how do I fix it?
Thank you

Hey I was going through some old post and checked out your one and if your code is still not running mine one will help you using function of getX() but you dint initialize it any where in code you may check out the code that might help you up