Small problem - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Small problem

IT_KidIT_Kid Posts: 4Member
Ok I'm relatively new to programming see i wrote this program and was pretty sure it was right but when i compile it says ';' expected on last line, but thing is it is the last line so it's '.' instead of ';' so could someone maybe help me find whats causing the problem.
Program FFL;
Uses WinCRT;

var
Member_name : Array[1..26] of string;
Membership_Dues : Array[1..26] of real;
Mission_Dues : Array[1..26] of real;
Building_Fund : Array[1..26] of real;
Project_Hope : Array[1..26] of real;
x : integer;
Mems_TC : Array[1..26] of real;
Procedure Members_Total_Contribution;
Begin
For x := 1 to 26 Do
Begin
Writeln('Enter a members name');
Readln(Member_name[x]);
Writeln('Enter membership dues');
Readln(Membership_Dues[x]);
Writeln('Enter mission dues');
Readln(Mission_Dues[x]);
Writeln('Enter Building fund contribution');
Readln(Building_Fund[x]);
Writeln('Enter Contribution to Project Hope');
Readln(Project_Hope[x]);
Mems_TC[x] := Membership_Dues[x] + Mission_Dues[x] + Building_Fund[x] + Project_Hope[x];
Writeln('Members total contribution is ',Mems_TC[x]);
End;
End;
Procedure Total_For_Category;
var
Membership_Dues_Total : real;
Mission_Dues_Total : real;
Building_Fund_Total : real;
Project_Hope_Total : real;
Begin
Membership_Dues_Total := 0;
Mission_Dues_Total := 0;
Building_Fund_Total := 0;
Project_Hope_Total := 0;
For x := 1 to 26 Do
Begin
Membership_Dues_Total := Membership_Dues_Total + Membership_Dues[x];
Mission_Dues_Total := Mission_Dues_Total + Mission_Dues[x];
Building_Fund_Total := Building_Fund_Total + Building_Fund[x];
Project_Hope_Total := Project_Hope_Total + Project_Hope[x];
End;
Writeln('Total membership dues is ',Membership_Dues_Total:2:2);
Writeln('Total mission dues is ',Mission_Dues_Total:2:2);
Writeln('Total Builduing Fund contribution is ',Building_Fund_Total:2:2);
Writeln('Total Project Hope contribution is ',Project_Hope_Total:2:2);
End;
Procedure Contribution_Percentage;
var
Overall_Contribution : real;
Percentage : real;
Begin
Overall_Contribution :=0;
For x := 1 to 26 Do
Begin
Overall_Contribution := Overall_Contribution + Mems_TC[x];
End;
For x := 1 to 26 Do
Begin
Percentage := (Mems_TC[x] / Overall_Contribution) *100;
Writeln('Percentage contribution is ',Percentage);
End;
End;
Procedure Search;
var
Found : boolean;
index : integer;
Search_value : string;
max : integer;
Begin
found := false;
max := 26;
index := 1;
Writeln('Enter the name of person you wish to search for');
Readln(Search_value);
While (found = false) and (index<max) Do
Begin
If Member_name[index] = Search_value then
Begin
Found := true;
End
Else
Begin
index := index + 1;
End;
End;
If Found = true then
Begin
Writeln('The person searched for is ',Member_name[index]);
Writeln('Thier total contribution is ',Mems_TC[index]:2:2);
End
Else
Begin
Writeln('Person not found');
End;
Begin
Members_Total_Contribution;
Total_For_Category;
Contribution_Percentage;
Search;
Readln;
End.
Small problem I know but if anyone could help I'd be grateful.

Comments

  • _Atex__Atex_ Posts: 163Member
    : Ok I'm relatively new to programming see i wrote this program and
    : was pretty sure it was right but when i compile it says ';' expected
    : on last line, but thing is it is the last line so it's '.' instead
    : of ';' so could someone maybe help me find whats causing the problem.
    [code]
    : Program FFL;
    : Uses WinCRT;
    :
    : var
    : Member_name : Array[1..26] of string;
    : Membership_Dues : Array[1..26] of real;
    : Mission_Dues : Array[1..26] of real;
    : Building_Fund : Array[1..26] of real;
    : Project_Hope : Array[1..26] of real;
    : x : integer;
    : Mems_TC : Array[1..26] of real;
    : Procedure Members_Total_Contribution;
    : Begin
    : For x := 1 to 26 Do
    : Begin
    : Writeln('Enter a members name');
    : Readln(Member_name[x]);
    : Writeln('Enter membership dues');
    : Readln(Membership_Dues[x]);
    : Writeln('Enter mission dues');
    : Readln(Mission_Dues[x]);
    : Writeln('Enter Building fund contribution');
    : Readln(Building_Fund[x]);
    : Writeln('Enter Contribution to Project Hope');
    : Readln(Project_Hope[x]);
    : Mems_TC[x] := Membership_Dues[x] + Mission_Dues[x] +
    : Building_Fund[x] + Project_Hope[x];
    : Writeln('Members total contribution is ',Mems_TC[x]);
    : End;
    : End;
    : Procedure Total_For_Category;
    : var
    : Membership_Dues_Total : real;
    : Mission_Dues_Total : real;
    : Building_Fund_Total : real;
    : Project_Hope_Total : real;
    : Begin
    : Membership_Dues_Total := 0;
    : Mission_Dues_Total := 0;
    : Building_Fund_Total := 0;
    : Project_Hope_Total := 0;
    : For x := 1 to 26 Do
    : Begin
    : Membership_Dues_Total := Membership_Dues_Total +
    : Membership_Dues[x];
    : Mission_Dues_Total := Mission_Dues_Total +
    : Mission_Dues[x];
    : Building_Fund_Total := Building_Fund_Total +
    : Building_Fund[x];
    : Project_Hope_Total := Project_Hope_Total +
    : Project_Hope[x];
    : End;
    : Writeln('Total membership dues is
    : ',Membership_Dues_Total:2:2);
    : Writeln('Total mission dues is ',Mission_Dues_Total:2:2);
    : Writeln('Total Builduing Fund contribution is
    : ',Building_Fund_Total:2:2);
    : Writeln('Total Project Hope contribution is
    : ',Project_Hope_Total:2:2);
    : End;
    : Procedure Contribution_Percentage;
    : var
    : Overall_Contribution : real;
    : Percentage : real;
    : Begin
    : Overall_Contribution :=0;
    : For x := 1 to 26 Do
    : Begin
    : Overall_Contribution := Overall_Contribution +
    : Mems_TC[x];
    : End;
    : For x := 1 to 26 Do
    : Begin
    : Percentage := (Mems_TC[x] / Overall_Contribution) *100;
    : Writeln('Percentage contribution is ',Percentage);
    : End;
    : End;
    : Procedure Search;
    : var
    : Found : boolean;
    : index : integer;
    : Search_value : string;
    : max : integer;
    : Begin
    : found := false;
    : max := 26;
    : index := 1;
    : Writeln('Enter the name of person you wish to search for');
    : Readln(Search_value);
    : While (found = false) and (index<max) Do
    : Begin
    : If Member_name[index] = Search_value then
    : Begin
    : Found := true;
    : End
    : Else
    : Begin
    : index := index + 1;
    : End;
    : End;
    : If Found = true then
    : Begin
    : Writeln('The person searched for is
    : ',Member_name[index]);
    : Writeln('Thier total contribution is
    : ',Mems_TC[index]:2:2);
    : End
    : Else
    : [red][b]{ Begin }[/b][/red]
    : Writeln('Person not found');
    : End;
    : Begin
    : Members_Total_Contribution;
    : Total_For_Category;
    : Contribution_Percentage;
    : Search;
    : Readln;
    : End.
    [/code]
    : Small problem I know but if anyone could help I'd be grateful.
    :

  • IT_KidIT_Kid Posts: 4Member
    Thank you I knew it was a little screw up.
  • lanxianglanxiang Posts: 11Member
    This post has been deleted.
Sign In or Register to comment.