Question: PERL SCRIPTING 1. Hotels are often rated using stars to represent their score. A five-star hotel may have a king-size bed, a kitchen, and two

PERL SCRIPTINGPERL SCRIPTING 1. Hotels are often rated using stars to represent their

1. Hotels are often rated using stars to represent their score. A five-star hotel may have a king-size bed, a kitchen, and two TVs; a one-star hotel may have cockroaches and a leaky roof, a. Write a subroutine called printstar that will produce a histogram to show the star rating for hotels shown in the following hash. The printstar function will be given two parameters: the name of the hotel and the number of its star rating. (Hint: sort the hash keys into an array. Use a loop to iterate through the keys, calling the printstar function for each iteration.) %hotels-("Pillowmint Lodge" => "5". "Buxton Suites" "5" "The Middletonian" => "3". "Notchbelow" "Rancho El Cheapo" => "1". "Pile Inn" (OUTPUT) Hotel Category Notchbelow The Middletonian ** Pillowmint Lodge **I Pile Inn Rancho El Cheapo Buxton Suites ae b. Sort the hotels by stars, five stars first, one star last. Can you sort the hash by values so that the five-star hotels are printed first, then four, and so forth? (See http:/lalvinalexander.com/perlledulgandalplaa00016.) Hotel Category Buxton Suites Pillowmint Lodge * Notchbelow The Middletonian ** Pile Inn Rancho El Cheapo ae

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!