Get the App
SLTechnology News&Howtos  ›  Development  › 

How to use C++ to realize the Information Management system of Teaching staff

Shulou Source: shulou.com Published: 2022-06-01 05:02:35 09月20日 Update

This article mainly introduces how to use C++ to achieve the staff information management system, the article is very detailed, has a certain reference value, interested friends must read it!

The details are as follows

I. problem description

A small company consists of four categories of personnel: managers, technicians, sales staff and sales managers. The salary of each category of personnel is calculated as follows: manager: fixed monthly salary (8000); technical staff: monthly salary according to technical grade (1-8) (1600 + grade * 300); sales staff: commission (4% * sales); sales manager: basic salary + commission (1500-0.2% * total sales) Design a management program to input, modify and display information for all kinds of people.

Two. Basic requirements

(1) use object-oriented programming ideas to write classes that need to be used in the development process, for example: design Person class: number, name, post, salary, member function can set a pure virtual function to calculate monthly salary; in addition, four classes for four types of personnel inherit Person; and add corresponding derived data members and functions, managers and sales managers can calculate monthly salary without new data members. Technicians add technical level data members, and salespeople add data members: sales. You also need to design a Manage class to accomplish various operations. An array of people, vector, with a base class pointer as the data type.

(2) need to use the menu function to display add people (input), modify information, browse information, search by name, sort monthly salary.

(3) for the sake of concise design, it is assumed that both the manager and the sales manager can only have one; use a text editor to edit a text file (a total of more than 20 people) containing information about all kinds of people; and can be modified and saved in the program.

Basic flow chart

# include#include#include#include#include#include#include#include # define filename "student.txt" using namespace std; class Person {public: Person (string, string, int = 0); / / Constructor double virtual pay_salary () = 0; / / borrow virtual function for wage initialization void virtual show (); / / display information bool operator

Tags: People sales managers information technology functions input payroll sales documents grades monthly salary success management members data errors design name sorting Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Information Shulou Tech Info NVidia Huawei Redmi