Sensor Range Coding Error Help

To any C programmer expert;
My name is Pierre Salsiccia , a mechanical Engineer and Artist. My son Marco became blind last year
due to complication with post surgery of retina detachment.
I am new at learning C programming. I was able to put together a code based on others to build a sonar for Marco
so that he can detect objects and avoid collisions.
I am almost there; but I have an error in the code I do not understand.
Please help me to find this error cause and remedial steps.
The error feed back is printed below:

sketch_Sonar_Range_Detector.ino: In function ‘void loop()’:
sketch_Sonar_Range_Detector:24: error: ‘microsecondsToInches’ was not declared in this scope
sketch_Sonar_Range_Detector:25: error: ‘microsecondsToCentimeters’ was not declared in this scope
sketch_Sonar_Range_Detector:84: error: a function-definition is not allowed here before ‘{’ token
sketch_Sonar_Range_Detector:91: error: a function-definition is not allowed here before ‘{’ token

The code is printed below:

#include <SoftwareSerial.h> // to read data from range finder PIN 7
#include
#include
const int pingPin = 7;
const int speakerPin = 8;
void setup() {
Serial.begin(9600);
}
void loop()
{ //establish variables for duration of the ping and distance in inches
long duration, inches, cm;
//the ping is triggered by a HIGH pulse of 2 or more microseconds
//to give a short LOW pulse beforehand to ensure a clean HIGH pulse
{
pinMode(pingPin, OUTPUT);
digitalWrite(pingPin, LOW);
delayMicroseconds(2);
digitalWrite(pingPin, HIGH);
delayMicroseconds(5);
//same pin 7 is used to read HIGH pulse duration in microseconds from sending to reception
pinMode(pingPin, INPUT);
duration = pulseIn(pingPin, HIGH);
// convert time to distance in inches
inches = microsecondsToInches(duration);
cm = microsecondsToCentimeters(duration);
if (inches <= 12)
{tone(speakerPin, 175, 500);
delay (100);
Serial.print(inches);
Serial.print(“in,”);
Serial.println();
delay (500);}
else if (inches > 12 && inches <= 32)
{tone(speakerPin, 220, 500);
delay (100);
Serial.print(inches);
Serial.print(“in,”);
Serial.println();
delay (500);}
else if (inches > 32 && inches <= 52)
{tone(speakerPin, 261, 500);
delay (100);
Serial.print(inches);
Serial.print(“in,”);
Serial.println();
delay (500);}
else if (inches > 52 && inches <= 71)
{tone(speakerPin, 329, 500);
delay (100);
Serial.print(inches);
Serial.print(“in,”);
Serial.println();
delay (500);}
else if (inches > 71 && inches <= 91)
{tone(speakerPin, 392, 500);
delay (100);
Serial.print(inches);
Serial.print(“in,”);
Serial.println();
delay (500);}
else if (inches > 91 && inches <= 110)
{tone(speakerPin, 494, 500);
delay (100);
Serial.print(inches);
Serial.print(“in,”);
Serial.println();
delay (500);}
else if (inches > 110 && inches <= 130)
{tone(speakerPin, 587, 500);
delay (100);
Serial.print(inches);
Serial.print(“in,”);
Serial.println();
delay (500);}
else if (inches > 130)
{tone(speakerPin, 700, 500);
delay (100);
Serial.print(inches);
Serial.print(“in,”);
Serial.println(); }
}
long microsecondsToInches(long microseconds)

{ // According to Parallax’s datasheet for the PING))), there are
// 73.746 microseconds per inch (i.e. sound travels at 1130 feet per
// second). This gives the distance travelled by the ping, outbound
// and return, so we divide by 2 to get the distance of the obstacle.
return microseconds / 74 / 2;
}
long microsecondsToCentimeters(long microseconds)
{
// The speed of sound is 340 m/s or 29 microseconds per centimeter.
// The ping travels out and back, so to find the distance of the
// object we take half of the distance travelled.
return microseconds / 29 / 2;
}}

Your help would be very much appreciated.
E-Mail: pierresalsiccia@yahoo.com

with your braces, you have these functions inside your loop() function:

put the cursor on the right side of the brace to see its counterpart…

long microsecondsToInches(long microseconds)

{ // According to Parallax's datasheet for the PING))), there are
  // 73.746 microseconds per inch (i.e. sound travels at 1130 feet per
  // second).  This gives the distance travelled by the ping, outbound
  // and return, so we divide by 2 to get the distance of the obstacle.
  return microseconds / 74 / 2;
}
long microsecondsToCentimeters(long microseconds)
{
  // The speed of sound is 340 m/s or 29 microseconds per centimeter.
  // The ping travels out and back, so to find the distance of the
  // object we take half of the distance travelled.
  return microseconds / 29 / 2;
}

see the problem here:

long microsecondsToCentimeters(long microseconds)
{
 // The speed of sound is 340 m/s or 29 microseconds per centimeter.
  // The ping travels out and back, so to find the distance of the
  // object we take half of the distance travelled.
  return microseconds / 29 / 2;
}} // <<this brace belongs to loop()
#include <microsecondsToinches>

Where did you put that?