Solved

procedure print

Posted on 1998-11-17
3
186 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

The conference as a whole was very interesting, although if one has to make a choice between this one and some others, you may want to check out the others.  This conference is aimed mainly at government agencies.  So it addresses the various compli…
This article shows how to use a free utility called 'Parkdale' to easily test the performance and benchmark any Hard Drive(s) installed in your computer. We also look at RAM Disks and their speed comparisons.
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

729 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