Solved

procedure print

Posted on 1998-11-17
3
179 Views
Last Modified: 2010-04-16
can anyone help me to do a procedure that prints out the file of each guest of a hotel?
hotel rec = serial no,guestname,telno,checkin date, checkout date and pay mode.the hotel has a max of 100 rooms,ie array[1..max] of integer

0
Comment
Question by:nad22
3 Comments
 

Author Comment

by:nad22
ID: 1216058
pls help me..........i need this in 1 day time.thx
0
 
LVL 2

Expert Comment

by:vx
ID: 1216059
I'm not sure about this, do you want to print it (to a printer) or put it on screen? If you want to print it, I'll have to look it up, but I think I can help you with that.

Type DateTime = Record
  Year: Integer;
  Month: Integer;
  Day: Integer;
end;

Type HotelRec = Record
  Serial: Integer;
  Name: String; { Perhaps you shouldn't allow this to be longer than the width of a page? }
  Telno: Integer;
  InDate: DateTime; { I've created a DateTime record for this }
  OutDate: DateTime; { See previous comment }
  PayMode: Integer; { Or create a Set of ways of paying or just make this a string }
end;

Var Hotel: HotelRec;

Procedure PrintHotelRecord(RecordToPrint: HotelRec);
  With RecordToPrint Do
  WriteLn('Serial: ',Serial);
  WriteLn('Name: ',Name);
  WriteLn('Telno: ',Telno);
  WriteLn('Check-in date: ',InDate.Year,'/',InDate.Month,'/',InDate.Day');
  WriteLn('Check-out date: ',OutDate.Year,'/',OutDate.Month,'/',OutDate.Day');
  WriteLn('PayMode: ',PayMode); { Or whatever is appropriate with the type you've chosen }
End;
0
 
LVL 3

Accepted Solution

by:
vikiing earned 50 total points
ID: 1216060
Provided that you've already loaded that array (named, let's say, "Room"), the process would be something like this:

    For i:=1 to Max do
        With Room[i] do
             Writeln(serialno,' ', guestname,' ',
                 checkindate,' ', checkoutdate,' ',
                 paymode);

I don't know format of dates, what is paymode, etc.; but I'm sure it will gives you a baseline from which to begin.

0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Learn how to PXE Boot both BIOS & UEFI machines with DHCP Policies and Custom Vendor Classes
A project that enables an administrator to perform actions within a user session context not just at the time of login but any time later on day(s) or week(s) later.
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question