23 lines
597 B
C
23 lines
597 B
C
|
#pragma once
|
||
|
|
||
|
// including a necessary library and namespace to work with strings
|
||
|
#include <string>
|
||
|
using namespace std;
|
||
|
|
||
|
// define the class
|
||
|
class car
|
||
|
{
|
||
|
private:
|
||
|
// define two fields, manufacturer and model
|
||
|
// this time as private to make the data only settable through the constructor or other local functions
|
||
|
std::string manufacturer;
|
||
|
std::string model;
|
||
|
|
||
|
public:
|
||
|
// define the constructor, taking manufacturer and model as parameters
|
||
|
car(std::string manufacturer, std::string model);
|
||
|
|
||
|
// define a method that will print out information
|
||
|
void print_info();
|
||
|
};
|