Exemplo n.º 1
0
int main()
{
  Dog x;
  x.setName("Lerothodi");
  x.setAge(5);
  x.setWeight(60);
  x.setBreed("German Shepherd");

  cout << "Name    : " << x.getName()     << endl;
  cout << "Age     : " << x.getAge()      << " years." << endl;;
  cout << "Weight  : " << x.getWeight()   << " lb."    << endl;
  cout << "Breed   : " << x.getBreed()    << endl;
  cout << "Lifespan: " << x.getLifespan() << endl;
  cout << endl;


  Pet y;
  y.setName("Leeuw");
  y.setAge(7);
  y.setWeight(55);

  cout << "Name    : " << y.getName()     << endl;
  cout << "Age     : " << y.getAge()      << " years." << endl;;
  cout << "Weight  : " << y.getWeight()   << " lb."    << endl;
  cout << "Lifespan: " << y.getLifespan() << endl;

  return 0;
}
Exemplo n.º 2
0
int main()
{
  Dog fido; // create a dog
  fido.speak();
  fido.wagTail();
  std::cout << "Fido is " << fido.getAge() << " years old\n";
  return 0;
}
Exemplo n.º 3
0
int main()
{
	Dog fido;
	fido.setAge(3);
	fido.setWeight(15);
	fido.setColor("brown");
	cout << "Fido is a " << fido.getColor() << " dog" << endl;
	cout << "Fido is " << fido.getAge() << " years old" << endl;
	cout << "Fido weight" << fido.getWeight() << " pounds" << endl;	
	fido.bark();
	return 0;
}
Exemplo n.º 4
0
void QT1::listItemChanged()
{
	int idx = this->getRepoListSelectedIndex();
	if (idx == -1)	return;
	std::vector<Dog> dogs = this->currentDogsInRepoList;
	if (idx > dogs.size())return;
	Dog s = dogs[idx];
	this->nameEdit->setText(QString::fromStdString(s.getName()));
	this->breedEdit->setText(QString::fromStdString(s.getBreed()));
	QString w;
	w.setNum(s.getAge());
	this->ageEdit->setText(w);
	this->linkEdit->setText(QString::fromStdString(s.getPhotograph()));
}
Exemplo n.º 5
0
int main() {
	cout << "!!!Hello World!!!" << endl; // prints !!!Hello World!!!
	Dog dog;
	cout << dog.getAge() << endl;
	return 0;
}