As a self-studying student, I need moderators to mark assignment.
Que: A goal post number is define as follows:
•it is greater than 0,
•it has five digits,
•its first and last digit are the same.
For 11111,93229,15432,121,132323231,and -23452.
Return 1 if its argument is a goal post number, otherwise return 0.
The function signature is
int isGoalPost(int []n);
Code java:
public static void main(string[] args){
Int[][] isGoalPost =new int{11111},{93229},{15432},{121},{132323231},{-23452}
};
{ string n = isGoalPost[i];
int firstNum=string n[0];
int fifthNum=string n[4];
int i;int j=0;
for(i=0;i<= isGoalPost.length;i++);
for(j=0;j<string n[i].length;j++);
If (n==5.length && firstNum==fifthNum && n<0);
return 1;
else return 0;
}
}
Re: As a self-studying student, I need moderators to mark assignment.
What happened when you ran the program? Does it work? Does it do what you expect?