assignment of function 'int val()'

i i have been asked to look at this for a friend, i do have some coding knowledge but not in this area, the product is fr my friends grandson, the error message above is being thrown after upload can someone please help me with this.

the error is in the last 5 lines of the code

// robot arm control hip, arm, forearm and grip
// using Arduino uno r3 and C program
void setup(){
const int hipPot=A0;                      // sets pin A0 as potentiometer control for hip movement
const int armPot=A1;                      // sets pin A1 as potentiometer control for arm movement
const int forearmPot=A2;                  // sets pin A2 as potentiometer control for forearm movement
const int gripPot=3;                     // sets pin A3 as potentiometer control for grip movement
const int hipMotor=9;                    // sets pin 9 as hip motor output
const int armMotor=6;                    // sets pin 6 as arm motor output
const int forearmMotor=5;                // sets pin 5 as forearm motor output
const int gripMotor=3;                   // sets pin 3 as grip motor output
pinMode (hipPot,INPUT);
pinMode (armPot,INPUT);
pinMode (forearmPot,INPUT);
pinMode (gripPot,INPUT);
pinMode (hipMotor,OUTPUT);
pinMode (armMotor,OUTPUT);
pinMode (forearmMotor,OUTPUT);
pinMode (gripMotor,OUTPUT);
int val();
 void loop();
Serial.begin(9600);                    // initialize serial communication at 9600 bits per sec
  val = analogRead(hipPot);            // reads the value of the hip potentiometer (value between 0 and 1023)
  val = map(val,0,1023,0,179);         // scale it to use it with the servo (value between 0 and 179 degrees)
  hipMotor.write(val);                 // sets the servo position according to the scaled value hip motor
  delay(15);                           // waits for the servo to get there
  val = analogRead(armPot);            // reads the value of the arm potentiometer (value between 0 and 1023)
  val = map(val,0,1023,0,179);         // scale it to use it with the servo (value between 0 and 179 degrees)
  armMotor.write(val);                 // sets the arm servo position according to the scaled value
  delay(15);                           // waits for the servo to get there
  val = analogRead(forearmPot);        // reads the value of the forearm potentiometer (value between 0 and 1023)
  val = map(val,0,1023,0,179);         // scale it to use it with the servo (value between 0 and 179 degrees)
  forearmMotor.write(val);             // sets the forearm servo position according to the scaled value)
  delay(15);                           // waits for the servo to get there
  [b]val = analogRead(gripPot);           // reads the value of the grip potentiometer (value between 0 and 1023)
  val = map(val,0,1023,0,90);          // scale it to use it with the servo (value between 0 and 90 degrees)
  gripMotor.write(val);                // sets the grip servo position according to the scaled value
  delay(15);                           // waits for the servo to get there
  }

sketch_4_servo_drive.ino (2.71 KB)

There a lot of errors in that code, not just the assignment of function 'int val().

To start:

All of the variable declarations are in setup so go out of scope as soon as setup() is done.

int val();

is a function declaration, not a variable declaration that it should be.

int val;
void loop();

The semicolon after loop() is an error and the required { to open the loop function is missing.

Serial.begin(9600);

Serial.begin in loop() is not an error, but setup() is the place for begin.

hipMotor.write(val);
armMotor.write(val);
forearmMotor.write(val);
gripMotor.write(val);

Are those servo motors? The Servo library is not included nor are the instances of the servos declared or attached. If they are not servos, what library are you using to control them that has a write() function?

Thank you for using code tags on your first post. It seldom happens that people read the guidelines before posting.

In the future, please include the entire text of error messages (in code tags). There is important information in the message that paraphrasing leaves out.

There's so much wrong with this code I can't even call it pseudocode. It won't compile in this state (not without changing/rearranging nearly every line), no idea what it's supposed to do even.

Who-ever wrote this had better start all over, preferably by studying a few Arduino beginner's tutorials and C++ beginner's tutorials.