Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Step 2 : There are several improvements which could be made to this program. For each recom - mended improvement below, modify the code to

Step 2: There are several improvements which could be made to this program. For each recom- mended improvement below, modify the code to implement the improvement.
Currently, the program expects the user to enter a lowercase y when the pet has been spayed or neutered. It would be better to permit the user to enter either a lowercase y or an uppercase Y. Using the logical OR operator, modify the conditional expressions of the if-else statements which compare variable spayed to y so the conditional expressions will check for either y or Y.
Currently, when an animal other than a cat or dog is entered (such as a javelina), the program asks if the animal has been spayed or neutered before displaying the message that only cats and dogs need pet tags. Determine and implement a way to make the program only execute the spay/neuter prompt and input when the pet type is cat or dog, but not when the pet type is something else.

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_2

Step: 3

blur-text-image_3

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

Understanding Databases Concepts And Practice

Authors: Suzanne W Dietrich

1st Edition

1119827949, 9781119827948

More Books

Students also viewed these Databases questions

Question

How do media shape our thinking?

Answered: 1 week ago