C CODE REQUIRED The Animal Insurance Company Writes a progra

C++ CODE REQUIRED:

The Animal Insurance Company:

Writes a program that repeatedly prints the insurance fee to pay for a pet according to the following rules:

A dog that has been neutered costs $50.

A dog that has not been neutered costs $80.

A cat that has been neutered costs $40.

A cat that has not been neutered costs $60.

A bird or reptile costs $10.

Any other animal generates an error message.

The program should prompt the user for the appropriate information, using a code to determine the kind of animal (i.e. D or d represents a dog, C or c represents a cat, B or b represents a bird ,R or r represents a reptile, and anything else represents some other kind of animal). After printing the insurance fee, the program should ask the user if (s) he wants to insure another animal using a repetition structure.

Solution

#include <iostream>

using namespace std;03

int main()

{

char neutered, opselect, animal;

const int dogcost = 80, catcost = 60, birdOrReptilecost = 0;

cout << \"What kind of animal do you have?\ \";

cout << \"d for dog, c for cat, b for bird or reptile and o for others.\ \ \";

cin >> animal;

cout << \"Answer the following questions\ \";

cout << \"With Y for yes or N for no.\ \ \";

cout << \"Is your pet neutered? \";

cin >> neutered;

cout << \"Enter a select code: \";

cout << \"\ 1)A dog that has been neutered: \";

cout << \"\ 2)A dog that has not been neutered: \";

cout << \"\ 3)A cat that has been neutered costs: \";

cout << \"\ 4)A cat that has not been neutered costs: \";

cout << \"\ 5)A bird or reptile: \";

cin >> opselect;

switch (opselect)

{

   case 1:

     cout << \"The price for dog that has been neutered is \" << dogcost - 30;

     break;

   case 2:

     cout << \"The price for dog that has not been neutered is \" << dogcost << endl;

    break;

   case 3:

     cout << \"The price for cat that has been neutered is \" << catcost - 20 << endl;

    break

   case 4:

     cout << \"The price for cat that has not been neutered is \" << catcost << endl;

    break;

   case 5:

     cout << \"The price for bird or reptile is \" << birdOrReptilecost << endl;

break;

return 0;

}

C++ CODE REQUIRED: The Animal Insurance Company: Writes a program that repeatedly prints the insurance fee to pay for a pet according to the following rules: A
C++ CODE REQUIRED: The Animal Insurance Company: Writes a program that repeatedly prints the insurance fee to pay for a pet according to the following rules: A

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site