Problem coding my LCD+Ic2 With my relay

Hi, Can someone guide me code this program. im working on changing the text to banana when the relay is off and apple when its turned on.

// Defines Libraries.
#include <NewPing.h>
#include <Wire.h> 
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 16, 2);



// defines pins numbers
const int trigPin = 3;
const int echoPin = 2;
const int relayPin = 4;

// defines variables
long duration;
int distance;
long inch;


void setup() {
lcd.begin();//Defining 16 columns and 2 rows of lcd display
lcd.backlight();//To Power ON the back light
//lcd.backlight();// To Power OFF the back light

  
  
  // put your setup code here, to run once:
pinMode(trigPin, OUTPUT); // Sets the trigPin as an Output
pinMode(echoPin, INPUT); // Sets the echoPin as an Input
pinMode(relayPin, OUTPUT);// Control Pin 
//Serial.begin(9600); // Starts the serial communication
}

void loop() {
  // put your main code here, to run repeatedly:
// Clears the trigPin
digitalWrite(trigPin, LOW);
delayMicroseconds(2);
// Sets the trigPin on HIGH state for 10 micro seconds
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
// Reads the echoPin, returns the sound wave travel time in microseconds
duration = pulseIn(echoPin, HIGH);
// Calculating the distance
distance = duration * 0.034 / 2;
inch=distance/2.54;


//Control 
  if(distance<15)
  {
    digitalWrite(relayPin, LOW);  // turn the pump on if distance less than 50 cm (HIGH is the voltage level)
    delay(1050);
    lcd.setCursor(0,0); 
    lcd.print(" BANANA "); 
   
    
 
    
    digitalWrite(relayPin, HIGH);  //For controlled dispensing
    delay(1000);
    lcd.setCursor(0,0); 
    lcd.print(" Apple "); 
   
}
else
  {
    digitalWrite(relayPin, HIGH);   // turn the pump off if distance greater than or equal to 50 cm (LOW is the voltage level)
  }
  
}

Just move the prints to the appropriate positions in the code.
Test.
Rinse and repeat.

you just need to update the LCD just when you set the relay pin LOW or HIGH.

digitalWrite(relayPin, HIGH);
lcd.setCursor(0,0);
lcd.print("APPLE  ");

or

digitalWrite(relayPin, LOW);
lcd.setCursor(0,0);
lcd.print("BANANA");

ensure you have the same number of characters in both strings to erase what was there before