Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

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

2025-02-21 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

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

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report