Help on Pascal Program: Preferences - Programmers Heaven

Howdy, Stranger!

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

Categories

Help on Pascal Program: Preferences

rodneybunkleyrodneybunkley Posts: 5Member
Hello. I need help on this program as well. I'm not really good at Pascal, but I'm really trying to get the hang of it...so please bare with me...

In this program I'm suppose to write a program to help match people up with apartments by their preferences. Each apartment is described in terms of 30 possible features. A 'Y' would indicate it has that feature and an 'N' would mean it does not.

Basically, I'm reading these preferences from a file called data9cust.dat, and I'm suppose to compare them to the apartment file called data9apts.dat ...and in the end I'm suppose to print a table containing the address of each apartment followed by the number of exact matches. If the number of matches is 80% or more of the total, I'm suppose to print 'POSSIBLE', otherwise 'NO'. So far this is what I've came up with...


PROGRAM PREFERENCES(INPUT, OUTPUT)

TYPE
ARY = ARRAY[1..30] OF CHAR;

VAR
CUST: ARY;

(*********************)

PROCEDURE LOAD(VAR PREFS:ARY); (*suppose to load customer preferences*)

VAR I: INTEGER;

BEGIN
FOR I:= 1 TO 30 DO
READ(DATA9.CUST,PREFS[I])
END;

(***************************)

PROCEDURE COMPARE(VAR PREFS: ARY); (*suppose to compare cust prefs to apartments)
(* don't know if it's fully right tho*)
VAR I: INTEGER;

BEGIN
FOR I:= 1 TO 30 DO
READ(DATA9.APTS,PREFS[I])
END;

(**************************)
PROCEDURE PRINTAPARTMENTADRESS (*SUPPOSE TO PRINT APARTMENT ADDRESS HERE*)


(***************************_

BEGIN

(*NOW HERE IS WHERE I'M SUPPOSE TO OPEN THE FILES,
AND THEN PRINT THE # OF MATCHES, AND PRINT POSSIBLE OR NO*)





END.

So can anyone help me with this?









Sign In or Register to comment.