Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // File: Student.cpp
- #include <string>
- #include <cstdio>
- #include <iostream>
- #include <sstream>
- #include "Student_H.h";
- // Constructor
- Student::Student(long i, std::string n, std::string adr) {
- this->setID(i);
- this->setName(n);
- this->setAddress(adr);
- }
- // Setters
- void Student::setID(long i) { ID = i; }
- void Student::setName(std::string n) { Name = n; }
- void Student::setAddress(std::string adr) { Address = adr; }
- // Getters
- long Student::getID() { return ID; }
- std::string Student::getName() { return Name; }
- std::string Student::getAddress() { return Address; }
- std::string Student::details() {
- std::ostringstream ss;
- ss << "Name: " << this->getName() << "[# " << this->getID() << "] address: " << this->getAddress();
- return ss.str();
- }
Add Comment
Please, Sign In to add comment