Giter VIP home page Giter VIP logo

qlhs's Introduction

Chương trình quản lý học sinh

Sinh viên thực hiện: BMD
Ma Sinh vien: 00000001

⭐ Cách sử dụng

  1. Clone repo
    $ git clone https://github.com/NghiaCaNgao/QLHS.git
  2. Change dir to the cloned repo
    $ cd QLHS
  3. Compile
    $ g++ main.cpp -o main
  4. Run
    $ main.exe

Tổ chức files

Được chia làm các phần chính như sau:

  • main.cpp : File chính của chương trình, tạo menu và điều hướng
  • /class
    • Student.h: Chứa các Object Classes
  • /module
    • Input.h: Chứa các functions nhập liệu
    • Validate.h: Chưa các functions kiểm tra nhập liệu

Cấu trúc dữ liệu

Chương trình được tổ chức thành các Module và các Object classes.

struct StudentData{};
class Student{};
class StudentList{}
class StudentManage : StudentList{}

Cấu trúc classes

Struct

Khối Struct lưu trữ các trường dữ liệu của học sinh:

struct StudentData
{
    char studentName[50], studentID[50];
    float mathScore, physicsScore, chemistryScore, averageScore;
    RankedAcademy rankedAcademy;
};

Enum

Enum lưu trữ các value cố định

enum RankedAcademy
{
    Excellent,
    VeryGood,
    Good,
    Average,
    BelowAverage,
};

enum Subject
{
    MATH,
    PHYSICS,
    CHEMISTRY,
    AVERAGESCORE
};

Detail

Student

Methods / Constructors Description
Student() public constructor Khởi tạo Stduent Object với các giá trị rỗng
Student(char studentID[50], char studentName[50], float mathScore, float physicsScore, float chemistryScore) public constructor Khởi tạo với các tham chiếu
Student(StudentData studentData) public constructor Khởi tạo với StudentData
void setStudent(char studentID[50], char studentName[50], float mathScore, float physicsScore, float chemistryScore) public method Đặt giá trị mới cho Stduent Object
void setStudent(StudentData studentData) public method Đặt giá trị bằng StudentData
StudentData getStudent() public method Trả về giá trị của Stduent Object hiện tại
void printStudent() public method In ra giá trị của Stduent Object hiện tại
void calcScore() Tính toán điểm trung bình và xếp hạng
StudentData studentData Biến lưu trữ thông tin
RankedAcademy calcRankedAcademy(float averageScore) Xếp hạng học tập

StudentList

Methods / Constructors Description
StudentList() Khởi tạo đối tượng Student List rỗng
clearStudentList() Xóa trắng đối tượng
addStudent(Student student) Thêm một đối tượng Student vào Student List
addStudents(StudentList studentList) Thêm một danh sách Stduent List vào student List hiện có
getStudentCount() Lấy số lượng student trong StduentList
getStudent(int index) Lấy một student qua index
removeStudent(int index) Xóa mọt đối tượng student trong studentList
void calcScore() Tính điểm trung bình cho toàn danh sách
printStudentList() In danh sách
std::vector<Student> studentList Property
int studentCount Property

** StudentManager **

Methods / Constructors Description
StudentManager() Khởi tạo một danh sách quản lý
StudentList getTop10(Subject subject) Lấy danh sách top 10 theo môn
void sortStudentList() Sort Danh sách theo điểm trung bình
void removeStudentsWithCondition(Subject subject, float max_value) Xóa các họ sinh có điểm môn nhỏ hơn max_value
void saveStudentList(const char *filePath) Lưu danh sách file
void readStudentList(const char *filePath) Đọc danh sách từ file

qlhs's People

Stargazers

Bronstein0x113c1c3 avatar

Watchers

DoTuanNghia avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.