New User Special Price Expires in

Let's log you in.

Sign in with Facebook


Don't have a StudySoup account? Create one here!


Create a StudySoup account

Be part of our community, it's free to join!

Sign up with Facebook


Create your account
By creating an account you agree to StudySoup's terms and conditions and privacy policy

Already have a StudySoup account? Login here


by: Isom Douglas V


Isom Douglas V
GPA 3.71

Huanjing Wang

Almost Ready


These notes were just uploaded, and will be ready to view shortly.

Purchase these notes here, or revisit this page.

Either way, we'll remind you when they're ready :)

Preview These Notes for FREE

Get a free preview of these Notes, just enter your email below.

Unlock Preview
Unlock Preview

Preview these materials now for free

Why put in your email? Get access to more of this material and other relevant free materials for your school

View Preview

About this Document

Huanjing Wang
Class Notes
25 ?




Popular in Course

Popular in ComputerScienence

This 2 page Class Notes was uploaded by Isom Douglas V on Wednesday September 30, 2015. The Class Notes belongs to CS 476G at Western Kentucky University taught by Huanjing Wang in Fall. Since its upload, it has received 28 views. For similar materials see /class/216693/cs-476g-western-kentucky-university in ComputerScienence at Western Kentucky University.




Report this Material


What is Karma?


Karma is the currency of StudySoup.

You can buy or earn more Karma at anytime and redeem it for class notes, study guides, flashcards, and more!

Date Created: 09/30/15
Fall 2007 Hands On Question Suppose that you are the owner of a small hotel which has 3 oors with 8 rooms on each oor numbered as 11 1218 on oor 1 212228 on oor 2 and 313238 on oor 3 Rooms with numbers which are an exact multiple of 5 contain a king size bed rooms with numbers that are an exact multiple of 4 contain a queen size bed rooms with numbers that are an exact multiple of 3 but not of 4 or 5 contain 2 double beds and all other rooms contain a single bed You want to create and maintain a Hotel simulation where the hotel starts off as empty People leave before noon and can check in after 100 PM on the day they arrive Rooms of the appropriate type are filled on the lowest available oor and with the smallest available room number If no room of the requested type is available the guest cannot check in The four command formats for the simulation are described below Read the commands from a file called hoteltxt There is exactly one command per line starting in column 1 and for the I command there is at least one blank between different fields in a given command but there might be more and other white spaces Command formats 1 D denotes the start of a new day at noon Output required none 2 F print current occupancy by oors Output required print the non vacant rooms by increasing oor and room numbers indicating who is in which room If the hotel is vacant print Hotel vacant 3 A print current occupancy alphabetically Output required print in alphabetical order the guests names and the number of the rooms they currently are in If the hotel is vacant print Hotel vacant 4 I name days type person requests a check in where name is a person s last name maximum of 20 characters days is the number of nights the person wants to stay type is the type of room the person requests where KKing QQueen D Double SSingle Output required If a room of the requested type was available the following output is printed Reservation is made for in room of type 7 for i nights where are filled in with the appropriate information If no room of the requested type was available the following output is printed Sorry all rooms of your requested type are filled Here is a sample input file and corresponding output D I Smith 2 K I Jones 1 K IMerci 1 S I Cary 3 K IZiegler 2 K iegler 1 K ee 2 Q F N gtUWUgtHHUWgt Reservation is made for Smith in room 15 of type K for 2 nights Reservation is made for Jones in room 25 of type K for 1 nights Reservation is made for Merci in room 11 of type S for 1 nights Reservation is made for Cary in room 35 of type K for 3 nights Sorry all rooms of your requested type are filled print an alphabetical list see below 1 print a list by oors see below 2 Reservation is made for Ziegler in room 25 of type K for 1 nights Reservation is made for Lee in room 12 of type Q for 2 nights print an alphabetical list see below 3 print a list by oors see below 4 print an alphabetical list see below 5 Printed list 1 Room 35 Cary Room 25 Jones Room 11 Merci Room 15 Smith Printed list 2 Room 11 Merci Room 15 Smith Room 25 Jones Room 35 Cary Printed list 3 Room 35 Cary Room 12 Lee Room 15 Smith Room 25 Ziegler Printed list 4 Room 12 Lee Room 35 Cary Printed list 5 Hotel vacant You can assume that the information in the file satisfies the described format and that no commands or room types are used in the file other than the ones described in this problem The number of commands in the file is not limited and the file can start or end with any of the four valid commands If you are programming in Java you may use the sun java documentation installed on the PC you are using there should be a shortcut on the desktop for it If you are using C or C you may use the MSDN documentation on the PC you are using You may not use the INTERNET N0 emajl n0 web searching n0 instant messaging n0 ftp etc If you use the network for any reason you are cheating


Buy Material

Are you sure you want to buy this material for

25 Karma

Buy Material

BOOM! Enjoy Your Free Notes!

We've added these Notes to your profile, click here to view them now.


You're already Subscribed!

Looks like you've already subscribed to StudySoup, you won't need to purchase another subscription to get this material. To access this material simply click 'View Full Document'

Why people love StudySoup

Steve Martinelli UC Los Angeles

"There's no way I would have passed my Organic Chemistry class this semester without the notes and study guides I got from StudySoup."

Janice Dongeun University of Washington

"I used the money I made selling my notes & study guides to pay for spring break in Olympia, Washington...which was Sweet!"

Jim McGreen Ohio University

"Knowing I can count on the Elite Notetaker in my class allows me to focus on what the professor is saying instead of just scribbling notes the whole time and falling behind."

Parker Thompson 500 Startups

"It's a great way for students to improve their educational experience and it seemed like a product that everybody wants, so all the people participating are winning."

Become an Elite Notetaker and start selling your notes online!

Refund Policy


All subscriptions to StudySoup are paid in full at the time of subscribing. To change your credit card information or to cancel your subscription, go to "Edit Settings". All credit card information will be available there. If you should decide to cancel your subscription, it will continue to be valid until the next payment period, as all payments for the current period were made in advance. For special circumstances, please email


StudySoup has more than 1 million course-specific study resources to help students study smarter. If you’re having trouble finding what you’re looking for, our customer support team can help you find what you need! Feel free to contact them here:

Recurring Subscriptions: If you have canceled your recurring subscription on the day of renewal and have not downloaded any documents, you may request a refund by submitting an email to

Satisfaction Guarantee: If you’re not satisfied with your subscription, you can contact us for further help. Contact must be made within 3 business days of your subscription purchase and your refund request will be subject for review.

Please Note: Refunds can never be provided more than 30 days after the initial purchase date regardless of your activity on the site.