Solved

procedure print

Posted on 1998-11-17
3
174 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 Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Moving applications to the cloud or switching services to cloud-based ones, is a stressful job.  Here's how you can make it easier.
In this article, I will show you HOW TO: Perform a Physical to Virtual (P2V) Conversion the easy way from a computer backup (image).
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

747 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now