Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PROGRAM checkIn: function checkIn(): PRINT What type of pet do you have? INPUT the customer's pet type WHILE the customer's pet type is not cat

image text in transcribed
PROGRAM checkIn: function checkIn(): PRINT \"What type of pet do you have?\" INPUT the customer's pet type WHILE the customer's pet type is not cat or dog PRINT \"Invalid pet type. Please specify cat or dog.\" INPUT the customer's pet type ENDWHILE IF the customer's pet type is a dog THEN IF available dog space is greater than 0 THEN RETURN true ELSE RETURN false ENDIF ELSE IF available cat space is greater than 0 THEN RETURN true ELSE RETURN false ENDIF ENDIF IF there is space available THEN PRINT "Has this pet stayed with us before? (Y/N)" INPUT Y or N WHILE input is not Y or N PRINT "Invalid response. Please enter Y or N." INPUT Y or N ENDHILE IF customer is an existing client THEN UPDATE existing pet information ELSE ADD new pet information ENDIF PRINT "How many days will the pet be staying with us?" INPUT the number of days IF the customer's pet type is a dog THEN IF the duration of the stay is greater than 2 days THEN SET grooming to TRUE ELSE SET grooming to FALSE ENDIF ENDIF IF the customer's pet type is a dog SET the dog's space number DECREMENT available dog space PRINT dog's space number ELSE SET the cat's space number DECREMENT available cat space PRINT cat's space number ENDIF ELSE PRINT "No Vacancy." ENDIF END

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Financial management theory and practice

Authors: Eugene F. Brigham and Michael C. Ehrhardt

12th Edition

978-0030243998, 30243998, 324422695, 978-0324422696

Students also viewed these Programming questions