Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C + + coding please Define a structure named. An imal with the following four fields: species ( string ) : Represents the species of

C++ coding please
Define a structure named. An imal with the following four fields:
species (string): Represents the species of the animal.
age (int): Represents the age of the animal.
weight (double): Represents the weight of the animal.
ispet (bool): Represents whether the animal can be a pet (true) or not (false).
Within the main function declare an Animal variable called myAnimal and prompt the user for input values for each of the fields as follows:
What is the species of the animal?
What is the age of the animal?
What is the weight of the animal?
Can this animal be a pet (y for yes, n for no)?
Within main, print out all of the information about the animal with the following format:
Animal Details:
Species:

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

Sql++ For Sql Users A Tutorial

Authors: Don Chamberlin

1st Edition

0692184503, 978-0692184509

More Books

Students also viewed these Databases questions