Solved

procedure print

Posted on 1998-11-17
3
184 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

Suggested Solutions

When using a search centre, I'm going to show you how to configure Sharepoint's search to only return results from the current site collection. Very useful when using Office 365 with multiple site collections.
Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

738 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