Untitled

mail@pastecode.io avatar
unknown
plain_text
7 months ago
954 B
2
Indexable
Never
#include <iostream>
#include <string>
using namespace std;

class Student{
public:
    Student(int korpus, string faculty, int group){
        this->korpus = korpus;
        this->faculty = faculty;
        this->group = group;
    }
    
  void displayInfo() {
        cout << "Корпус: " << korpus << endl;
        cout << "факультет: " << faculty << endl;
        cout << "Группа: " << group << endl;
       
    }
    void setKorpus(int korpus) {
        this->korpus = korpus;
    }

    void setFaculty(string faculty) {
        this->faculty = faculty;
    }

    void setGroup(int group) {
        this->group = group;
    }


private:

    int korpus;
    string faculty;
    int group;
};

    int main() 
    {
    // Создание объекта класса Student
    Student person( 9, "ОИБ", 932);

    // Вывод информации о студенте
    person.displayInfo();

   
    return 0;
    }


Leave a Comment