23 lines
611 B
C++
23 lines
611 B
C++
// include the header file
|
|
#include "car.h"
|
|
|
|
// include necessary libraries and namespaces
|
|
#include <iostream>
|
|
#include <string>
|
|
using namespace std;
|
|
|
|
// define the implementation for car.print_info()
|
|
void car::print_info()
|
|
{
|
|
cout << "Car Information:" << endl;
|
|
// fields that are defined in the header file can just be used like normal variables here
|
|
cout << "- manufacturer: " << manufacturer << endl;
|
|
cout << "- model: " << model << endl;
|
|
}
|
|
|
|
/*
|
|
|
|
That's everything for the .cpp file.
|
|
Since fields don't have an implementation and are already defined in the header file, they can be left out here.
|
|
|
|
*/ |