help with c++...paste indented code plzz
#include <iostream>
using namespace std;
class Animal
{
private:
string species;
int age;
public:
//Default constructor
Animal()
{
species = "unknown";
age = 0;
}
Animal(string sp, int ag)
{
species = sp;
age = ag;
}
//Setter methods
void setSpecies(string x) { species = x; }
void setAge(int x) { age = x; }
//Setter methods
string getSpecies() { return species; }
int getAge() { return age; }
};
int main()
{
Animal a, b("Dog", 10);
cout<<a.getSpecies()<<endl;
cout<<a.getAge()<<endl;
cout<<b.getSpecies()<<endl;
cout<<b.getAge()<<endl;
return 0;
}
Step by stepSolved in 2 steps with 1 images
- List two features we used from the C++ standard library, including a short explanation of why you would use the feature and which header file must be included. Example: The std::cin object is found in the iostream header file and is used to read characters from the keyboard.arrow_forwardstring is a primitive type of C++ True Falsearrow_forwardA pointer variable is a special kind of variable that may be used in C++. Do you have an understanding of how to make use of it?arrow_forward
- Computer Networking: A Top-Down Approach (7th Edi...Computer EngineeringISBN:9780133594140Author:James Kurose, Keith RossPublisher:PEARSONComputer Organization and Design MIPS Edition, Fi...Computer EngineeringISBN:9780124077263Author:David A. Patterson, John L. HennessyPublisher:Elsevier ScienceNetwork+ Guide to Networks (MindTap Course List)Computer EngineeringISBN:9781337569330Author:Jill West, Tamara Dean, Jean AndrewsPublisher:Cengage Learning
- Concepts of Database ManagementComputer EngineeringISBN:9781337093422Author:Joy L. Starks, Philip J. Pratt, Mary Z. LastPublisher:Cengage LearningPrelude to ProgrammingComputer EngineeringISBN:9780133750423Author:VENIT, StewartPublisher:Pearson EducationSc Business Data Communications and Networking, T...Computer EngineeringISBN:9781119368830Author:FITZGERALDPublisher:WILEY