Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<string>
- #include <cstdlib>
- using namespace std;
- class house
- {
- public:
- house() {
- floors = 3;
- rooms = 20;
- }
- int getFloors() {
- return floors;
- }
- int getRooms() {
- return rooms;
- }
- private:
- int floors;
- int rooms;
- };
- class Houseadress : public house
- {
- public:
- Houseadress(string s, int p) {
- address = s;
- pincode = p;
- }
- string getAddress() {
- return address;
- }
- int getPin() {
- return pincode;
- }
- private:
- string address;
- int pincode;
- };
- {
- Houseadress h1("fdljfhslfhlsflshf", 200);
- cout << "Rooms: " << h1.getRooms() << endl;
- cout << "Floors: " << h1.getRooms() << endl;
- cout << "address: " << h1.getAddress() << endl;
- cout << "zipcode: " << h1.getPin() << endl;
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment