CPP 학생 관리 프로그램

실습과제 모음 2014. 4. 26. 16:18 Posted by TanSanC
336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.

#include <iostream>

#include <string>

using namespace std;

// 학생관리프로그램

// 로그인

// 관리자or 학생

// 1~4학년의학생이존재한다.

// 1학년: 성적확인, 이름, 성적

// 2학년: 성적확인, 이름, 성적

// 3학년: 성적확인, 전공변경, 이름, 성적, 전공

// 4학년: 성적확인, 전공변경, 졸업요건확인, 이름, 성적, 전공

// 관리자모드

// 학생등록

// 학생수정

// 학생삭제

// 성적입력

class FreshMan

{

public:

    string name;

    double grade;

};

class StudentInfo

{

public:

    string studentNumber;

    string name;

    int grade;

};

 

 

int main( )

{

    StudentInfo si[100];

    int siCount = 0;

 

    while(1)

    {

        string loginName;

        cout << "로그인: " << endl;

        cout << "(학생일경우학번, 관리자일경우admin 을입력하세요" << endl;

        cin >> loginName;

 

        while(1)

        {

            if( loginName == "admin" )

            {

                system("cls");

               cout << "Admin 모드로시작합니다." << endl;

                // Admin Mode Start

                cout << "======Menu======" << endl;

                cout << "=1. 학생등록 =" << endl;

                cout << "=2. 학생수정 =" << endl;

                cout << "=3. 학생삭제 =" << endl;

                cout << "=4. 성적입력 =" << endl;

                cout << "=5. 나가기  =" << endl;

                cout << "================" << endl;

                int mode;

                cin >> mode;

                if( mode == 1 )

                {

                    system("cls");

                    cout << "= 학생등록Mode =" << endl;

                    cout << "학번:" ;

                    cin >> si[siCount].studentNumber;

                    cout << "이름:" ;

                    cin >> si[siCount].name;

                    cout << "학년:" ;

                    cin >> si[siCount].grade;

                    siCount++;

 

                    cout << "등록완료" << endl;

                }

                else if( mode == 5 )

                {

                    break;

                }

            }

            else

            {

                cout << "학생모드로시작합니다." << endl;

                cout << "학번: " << loginName << endl;

 

            }

        }

    }

    return 0;

}

'실습과제 모음' 카테고리의 다른 글

반복문 실습 별찍기 예제  (0) 2014.05.31
CPP 문자열 찾기 실습 답  (0) 2014.04.26
CPP 문자열 클래스 실습  (0) 2014.04.26
studentInfo 실습  (1) 2014.04.19
C 배열 연습문제  (0) 2014.04.13