Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

procedure print

Posted on 1998-11-17
3
Medium Priority
?
194 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 100 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
Experts give $3,000 toward hurricane relief efforts—but that's not all!
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

661 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