ok well iv done the assignment but i cant get the program to run properly heres the code for pascal and pseudo code i just need to know what i am doing wrong.
What it states in the instruction
A Company allocates golfing hours to its directors at the end of each month.
Write a program into which the current numbers of directors is then passed to a function which requests the names and the total number of golfing hours accumulated at the start of the current month for each director. During the month, the number of hours worked during the day by each director is added to a list. Assume that no two directors work the same number of hours in a month. These list are used as inputs to the function to determine the total number of hours worked per director during the month (hours = 0 indicates the end of each directors list ). Directors are given one hours golfing for every eight hours work that they submit.
The Function prints a report for each director showing the directors name, golfing hours accumulated at the start of the month ,and the total number of golfing hours earned during the month and the total number of golfing phones accumulated at the end of the month.
A summary at the end of the report shows the name and number of golfing hours of the director who has accumulated the most hours.
The Total number of directors who have morethan 50 hours golfing time is returned to the main program which prints the number.
BEGIN
Ghours = 0
TOTALWH = 0
do While Whours = 0
INPUT NAME
INPUT HOURS WORKED
INPUT ADDITIONAL GOLFING HOURS
Ghours = Hours Worked / 8
TotGhours = Ghours + ADDITIONAL GOLFING HOURS
//summary
PRINT NAME
PRINT Ghours
PRINT ADDITIONAL GOLFING HOURS
PRINT TOTAL GOLFING HOURS
//DIR HIGH EANERS
PRINT NAME
PRINT HOURS
IF Ghours >50 THEN
PRINT Ghours >50
END
program HOURS;
uses crt;
var Name: string;
var GHours, TotGHours, AddGHours, Whours, totalWH: integer;
begin
CLRSCR;
Ghours := 0; totalWH :=0;
//REPEAT CODE
repeat
WRITELN('Enter Name ');
READLN(Name);
WRITELN('Enter Hours Worked ');
READLN(Whours);
WRITELN('Enter any Additional hours ');
READLN(AddGHours);
Ghours := Whours DIV 8;
TotGHours := Ghours + AddGHours ;
totalWH := Whours + 1 ;
until Whours = 0;
//SUMMARY
WRITELN('Name: ',Name );
WRITELN('Golfing Hours Earned: ',Ghours);
WRITELN('Additional Golfing Hours: ', AddGHours);
//HIGHEST EARNING MEMBERS
WRITELN('Total Golfing Hours: ',TotGHours);
WRITELN('Highest Earners',Name,':',GHours);
//DIR WITH MORETHAN 50 HOURS OF PLAY TIME
if TotGHours >50
then WRITELN('Total Hours', TotGHours >50);
While not keypressed do
end.
What it states in the instruction
A Company allocates golfing hours to its directors at the end of each month.
Write a program into which the current numbers of directors is then passed to a function which requests the names and the total number of golfing hours accumulated at the start of the current month for each director. During the month, the number of hours worked during the day by each director is added to a list. Assume that no two directors work the same number of hours in a month. These list are used as inputs to the function to determine the total number of hours worked per director during the month (hours = 0 indicates the end of each directors list ). Directors are given one hours golfing for every eight hours work that they submit.
The Function prints a report for each director showing the directors name, golfing hours accumulated at the start of the month ,and the total number of golfing hours earned during the month and the total number of golfing phones accumulated at the end of the month.
A summary at the end of the report shows the name and number of golfing hours of the director who has accumulated the most hours.
The Total number of directors who have morethan 50 hours golfing time is returned to the main program which prints the number.
BEGIN
Ghours = 0
TOTALWH = 0
do While Whours = 0
INPUT NAME
INPUT HOURS WORKED
INPUT ADDITIONAL GOLFING HOURS
Ghours = Hours Worked / 8
TotGhours = Ghours + ADDITIONAL GOLFING HOURS
//summary
PRINT NAME
PRINT Ghours
PRINT ADDITIONAL GOLFING HOURS
PRINT TOTAL GOLFING HOURS
//DIR HIGH EANERS
PRINT NAME
PRINT HOURS
IF Ghours >50 THEN
PRINT Ghours >50
END
program HOURS;
uses crt;
var Name: string;
var GHours, TotGHours, AddGHours, Whours, totalWH: integer;
begin
CLRSCR;
Ghours := 0; totalWH :=0;
//REPEAT CODE
repeat
WRITELN('Enter Name ');
READLN(Name);
WRITELN('Enter Hours Worked ');
READLN(Whours);
WRITELN('Enter any Additional hours ');
READLN(AddGHours);
Ghours := Whours DIV 8;
TotGHours := Ghours + AddGHours ;
totalWH := Whours + 1 ;
until Whours = 0;
//SUMMARY
WRITELN('Name: ',Name );
WRITELN('Golfing Hours Earned: ',Ghours);
WRITELN('Additional Golfing Hours: ', AddGHours);
//HIGHEST EARNING MEMBERS
WRITELN('Total Golfing Hours: ',TotGHours);
WRITELN('Highest Earners',Name,':',GHours);
//DIR WITH MORETHAN 50 HOURS OF PLAY TIME
if TotGHours >50
then WRITELN('Total Hours', TotGHours >50);
While not keypressed do
end.