Skip to content

Instantly share code, notes, and snippets.

@dibakarsutradhar
Created September 2, 2018 07:57
Show Gist options
  • Save dibakarsutradhar/e3740784b6e6538eac1f4d96df2e90ce to your computer and use it in GitHub Desktop.
Save dibakarsutradhar/e3740784b6e6538eac1f4d96df2e90ce to your computer and use it in GitHub Desktop.
#include <iostream>
#include <string>
using namespace std;
class CarMake {
public:
string m_make;
string m_model;
int m_year;
float m_price;
void print(){
cout << "Car Make: " << m_make << " Car Model: " << m_model << " Car Year: " << m_year << " Car Price: $" << m_price << " USD." << endl;
}
};
int main(){
CarMake ferrari { "Ferrari", "LaFerrari", 2015, 100000.00 };
CarMake bugatti { "Bugatti", "Chiron", 2017, 250000.00 };
ferrari.print();
bugatti.print();
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment