/***************************************************************************
 * This program illustrates the use of structs to group data.
 ***************************************************************************/

#include <iostream>
#include <string>
using std::cin;           
using std::cout;            
using std::endl; using std::string;

struct car{
	string model;
	string make;
	int year;
};
	




	
int main()
{
	car bessie={"Outback", "Subaru", 2002};
	cout<<"Bessie is a "<<bessie.year<<" "<<bessie.make<<" "
		<<bessie.model<<".\n";
	car shorty;//0-parameter constructor. int gets garbage. Strings 
		   //are empty.
	cout<<"Shorty was a "<<shorty.year<<" "<<shorty.make<<" "
		<<shorty.model<<".\n";
	shorty.model="CRX";
	shorty.make="Honda";
	shorty.year=1985;
	cout<<"Shorty was a "<<shorty.year<<" "<<shorty.make<<" "
		<<shorty.model<<".\n";
	shorty.year=1986;//assign a value to member data
	cout<<"or maybe a "<<shorty.year<<" "<<shorty.make<<" "
		<<shorty.model<<".\n";
	car wrecked=shorty;
	wrecked.year=1987;
	cout<<"Sadly, I wrecked the "<<wrecked.year<<" "<<wrecked.model<<",\n";
	cout<<"or maybe a "<<shorty.year<<" "<<shorty.make<<" "
	<<shorty.model<<".\n";
       	return 0;
}


