Need Help with Encapsulation Assignment.
When running my code, I keep getting No Output. Tried tinkering with the code for a while but couldn't come up with a fix. #include <iostream> using namespace std; //class definition class Car{ //private area private: int horsepowers; //public area public: //complete the setter function void setHorsepowers(int x) { horsepowers = x; } //complete the getter function int getHorsepowers() { return horsepowers; } }; int main() { //getting input int horsepowers; cin >> horsepowers; //creating the object of class Car Car car; //setting the value for private member car.setHorsepowers(horsepowers); //printing the value of private member if (car.getHorsepowers() > 800){ cout << "Too much" << endl; } else cout << car.getHorsepowers(); return 0; }