C源码(102)

C源码(102)
C源码(102)

C源码Part One

BaseStatic.cpp : implementation file

#include "stdafx.h"

#include "MyProject.h"

#include "BaseStatic.h"

#ifdef _DEBUG

#define new DEBUG_NEW

#undef THIS_FILE

static char THIS_FILE[] = __FILE__;

#endif

CBaseGxStatic

CBaseGxStatic::CBaseGxStatic()

{

}

CBaseGxStatic::~CBaseGxStatic()

{

}

BEGIN_MESSAGE_MAP(CBaseGxStatic, CStatic)

{{AFX_MSG_MAP(CBaseGxStatic)

ON_WM_GXPAINT()

}}AFX_MSG_MAP

END_MESSAGE_MAP()

CBaseGxStatic message handlers

void CBaseGxStatic::OnPaint()

{

CPaintDC dc(this); device context for painting

dc.SetBkColor(m_GxbkColor);

dc.SetTextColor(m_GxTextColor);

CFont pfont=this->GetParent()->GetFont();

CFont pf;

pf=dc.SelectObject(pfont);

TODO: Add your message handler code here

CString sCaption;

this->GetWindowText(sCaption);

CRect rcWnd;

this->GetClientRect(&rcWnd);

dc.DrawText(sCaption,rcWnd,DT_VCENTER|DT_SINGLELINE);

::DeleteObject(pfont);

Do not call CStatic::OnPaint() for painting messages

}

void CBaseGxStatic::SetBkColor(COLORREF bkColor)

{

m_GxbkColor=bkColor;

}

void CBaseGxStatic::SetTextColor(COLORREF TextColor)

{

m_GxTextColor=TextColor;

}

void CBaseGxStatic::PreSubclassWindow()

{

SetTextColor();

SetBkColor();

CStatic::PreSubclassWindow();

}

C源码Part Two

#include "myfunction.h"

#if !defined(AFX_DLGRKQUERY_H__62A83F3A_DEFC_425D_91EC_9C7F30595DEF__INC LUDED_)

#define

AFX_DLGRKQUERY_H__62A83F3A_DEFC_425D_91EC_9C7F30595DEF__INCLUDED_ #if _MSC_VER > 1000

#pragma once

#endif _MSC_VER > 1000

DlgRkQuery.h : header file

CDlgRkQuery dialog

class CDlgRkQuery : public CDialog

{

Construction

public:

bool RefreshRkListView(CString sql);

bool InitRkListView();

CDlgRkQuery(CWnd pParent = NULL); standard constructor

Dialog Data

{{AFX_DATA(CDlgRkQuery)

enum { IDD = IDD_DIALOG_RK_QUERY };

CListCtrl m_GxlistRK;

}}AFX_DATA

LRunSql m_Gxrunsql;

CString m_GxsRk_ph;

Overrides

ClassWizard generated virtual function overrides

{{AFX_VIRTUAL(CDlgRkQuery)

protected:

virtual void DoDataExchange(CDataExchange pDX); DDXDDV support

}}AFX_VIRTUAL

Implementation

protected:

Generated message map functions

{{AFX_MSG(CDlgRkQuery)

virtual void OnOK();

afx_msg void OnButtonOk();

virtual BOOL OnInitDialog();

afx_msg void OnDblclkListRkView(NMHDR pNMHDR, LRESULT pResult);

}}AFX_MSG

DECLARE_MESSAGE_MAP()

};

{{AFX_INSERT_LOCATION}}

Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif !defined(AFX_DLGRKQUERY_H__62A83F3A_DEFC_425D_91EC_9C7F30595DEF_ _INCLUDED_)

C源码Part Three

DBaseDlg.cpp : implementation file

#include "stdafx.h"

#include "MyProject.h"

#include "DBaseDlg.h"

#ifdef _DEBUG

#define new DEBUG_NEW

#undef THIS_FILE

static char THIS_FILE[] = __FILE__;

#endif

#include "ExternDllHeader.h"

CDBaseDlg dialog

bool IsTime(CString sDate);

CDBaseDlg::CDBaseDlg(RxGrid Grid,CString sIdentify, int nNumberStyle,CWnd pParent =NULL)

: CDialog(CDBaseDlg::IDD, pParent)

{

m_GxpGrid=Grid;

m_GxIdentify=sIdentify;

m_GxNumberStyle=nNumberStyle;

pEdt = NULL;

pSta = NULL;

{{AFX_DATA_INIT(CDBaseDlg)

NOTE: the ClassWizard will add member initialization here

}}AFX_DATA_INIT

}

void CDBaseDlg::DoDataExchange(CDataExchange pDX)

{

CDialog::DoDataExchange(pDX);

{{AFX_DATA_MAP(CDBaseDlg)

DDX_Control(pDX, IDC_STATITLE, m_GxStaTitle);

DDX_Control(pDX, IDC_BUTNEW, m_GxButCommand[0]);

DDX_Control(pDX, IDC_BUTCHANGE, m_GxButCommand[1]);

DDX_Control(pDX, IDC_BUTCOPY, m_GxButCommand[2]);

DDX_Control(pDX, IDC_BUTDELE, m_GxButCommand[3]);

DDX_Control(pDX, IDC_BUTSA VE, m_GxButCommand[4]);

DDX_Control(pDX, IDC_BUTUNDO, m_GxButCommand[5]);

DDX_Control(pDX, IDC_BUTEXIT, m_GxButCommand[6]);

}}AFX_DATA_MAP

}

BEGIN_MESSAGE_MAP(CDBaseDlg, CDialog)

{{AFX_MSG_MAP(CDBaseDlg)

ON_WM_GXPAINT()

ON_BN_CLICKED(IDC_BUTEXIT, OnButexit)

ON_BN_CLICKED(IDC_BUTUNDO, OnButundo)

ON_BN_CLICKED(IDC_BUTSA VE, OnButsave)

ON_BN_CLICKED(IDC_BUTNEW, OnButnew)

ON_BN_CLICKED(IDC_BUTDELE, OnButdele)

ON_BN_CLICKED(IDC_BUTCOPY, OnButcopy)

ON_BN_CLICKED(IDC_BUTCHANGE, OnButchange)

}}AFX_MSG_MAP

END_MESSAGE_MAP()

CDBaseDlg message handlers

void CDBaseDlg::OnOK()

{

TODO: Add extra validation here

CDialog::OnOK();

}

void CDBaseDlg::OnPaint()

{

CPaintDC dc(this); device context for painting

CRect rcClient;

this->GetClientRect(&rcClient);

rcClient.top=rcClient.top+8;

rcClient.bottom=rcClient.bottom-8;

rcClient.left=rcClient.left+8;

rcClient.right=rcClient.right-8;

COLORREF SystemColor=::GetSysColor(COLOR_3DFACE);

CBrush brush,pbrush;

brush.CreateSolidBrush(SystemColor);

pbrush=dc.SelectObject(&brush);

dc.Rectangle(rcClient);

dc.SelectObject(pbrush);

brush.DeleteObject();

dc.MoveTo(8,68);

dc.LineTo(rcClient.Width()+8,68);

}

BOOL CDBaseDlg::OnInitDialog()

{

CDialog::OnInitDialog();

根据表格信息创建窗口

nCol=m_GxpGrid->GetCols();

pEdt=new CBaseGxEdit[nCol];

pSta=new CStatic[nCol];

m_GxColCount=nCol;

char pcolumstr = new char[100];

取出表头

LVCOLUMN column;

CString sColCaption;

column.mask=LVCF_TEXT;

column.pszText=pcolumstr;sColCaption.GetBuffer(sColCaption.GetLength());

https://www.360docs.net/doc/4d10289512.html,hTextMax=20;

根据列数分配在表单上的位置

取出屏幕分辨率

int xPix=::GetSystemMetrics(SM_GXCXSCREEN);

int yPix=::GetSystemMetrics(SM_GXCYSCREEN);

int nWidth,nHeight;

nWidth=xPix4;

nHeight=(yPix-200)(12+5);

CRect rcSta,rcEdit;

CString ColCaption;

分配空间

rcSta.left=12;

rcSta.top=70+10;

rcSta.right=rcSta.left+(nWidth25);

rcSta.bottom=rcSta.top+nHeight;

rcEdit.left=rcSta.right;

rcEdit.right=rcEdit.left+(nWidth12);

rcEdit.top=rcSta.top;

rcEdit.bottom=rcSta.bottom;

if(nCol<=13)

rcEdit.right=490;

for(int i=0;i

{

取出表头

m_GxpGrid->GetColumn(i,&column);

ColCaption = column.pszText+":";

ColCaption.Format("%s:",column.pszText);

创建标签

pSta[i].Create(ColCaption,WS_CHILD,rcSta,this);

pSta[i].ShowWindow(SW_SHOW);

计算下一个标签位置

if((i+1)%13==0)

{

rcSta.top=70+10;

rcSta.bottom=rcSta.top+nHeight;

rcSta.left=rcSta.left+nWidth-5;

rcSta.right=rcSta.left+(nWidth12);

}

else

{

rcSta.top=rcSta.bottom+5;

rcSta.bottom=rcSta.top+nHeight;

}

pEdt[i].Create(WS_CHILD|WS_BORDER|WS_TABSTOP|ES_AUTOHSCROLL,rcEdit,this ,WM_GXUSER+100+i);

pEdt[i].ShowWindow(SW_SHOW);

pEdt[i].SetDlgCtrlID(i);

pEdt[i].SetReadOnly(); 计算下一个文本框的位置

if((i+1)%13==0)

{

rcEdit.top=70+10;

rcEdit.bottom=rcEdit.top+nHeight;

rcEdit.left=rcEdit.left+nWidth-5;

rcEdit.right=rcEdit.left+(nWidth12);

}

else

{

rcEdit.top=rcEdit.bottom+5;

rcEdit.bottom=rcEdit.top+nHeight;

}

}

重新调整窗口大小

CRect rcWnd,rcNewWindow;

rcWnd.top=0;

rcWnd.left=0;

rcWnd.bottom=rcEdit.bottom+46;

rcWnd.right=516;

delete []pcolumstr;

居中显示

rcNewWindow.left=xPix2-rcWnd.Width()2;

rcNewWindow.right=rcNewWindow.left+rcWnd.Width();

rcNewWindow.top=xPix2-rcWnd.Height()2-70;

rcNewWindow.bottom=rcNewWindow.top+rcWnd.Height();

if(nCol<14)

{

this->MoveWindow(rcNewWindow);

MoveButton(13,rcEdit.top);

}

else

{

this->ShowWindow(SW_SHOWMAXIMIZED);

MoveButton(xPix-500,yPix-120);

}

设置窗口标题

CString sCaption;

this->GetParent()->GetWindowText(sCaption);

sCaption=sCaption.Left(sCaption.GetLength()-4);

this->SetWindowText(sCaption+"维护");

m_GxDataBaseName=sCaption+"表";

设置字符某些只允许输入数字

RxRecordset rst;

rst.Open(m_GxDataBaseName);

for(i=0;i

{

if(rst.GetFieldType(i)=="数值型")

pEdt[i].IsMoneyOnly(true);

if(rst.GetFieldType(i)=="逻辑型")

pEdt[i].IsBoolOnly(true);

}

this->Invalidate();

this->GetClientRect(&rcNewWindow);

调整标题区域大小

this->m_GxStaTitle.MoveWindow(16,16,rcNewWindow.right-32,38,true);

this->m_GxStaTitle.SetWindowText(sCaption+"维护");

Display();

return TRUE; return TRUE unless you set the focus to a control

EXCEPTION: OCX Property Pages should return FALSE }

void CDBaseDlg::OnButnew()

{

Clear();

OnButcopy();

}

void CDBaseDlg::OnButchange()

{

m_GxIsAdd=false;

Enabled(true);

}

void CDBaseDlg::OnButdele()

{

if(MessageBox("确定要删除这条记录吗?","系统提示",MB_OKCANCEL|MB_ICONQUESTION)!=1)

return;

CString sSQL,sID,sValue;

pSta[0].GetWindowText(sID);

sID=sID.Left(sID.GetLength()-1);

pEdt[0].GetWindowText(sValue);

RxRecordset rst;

rst.Open(m_GxDataBaseName);

CString sType=rst.GetFieldType(0);

if(sType="字符型")

sSQL.Format("DELETE FROM %s WHERE %s='%s'",m_GxDataBaseName,sID,sValue);

else

sSQL.Format("DELETE FROM %s WHERE %s=%s",m_GxDataBaseName,sID,sValue);

rst.Open(sSQL,adCmdText);

this->OnCancel();

}

void CDBaseDlg::OnButcopy()

{

CString sSmallCaption,sCaption;

m_GxIsAdd=true;

Enabled(true);

CString NewNumber;

RxRecordset rst;

sCaption=rst.GetFieldName(0);

rst.Open(m_GxDataBaseName);

CString sType=rst.GetFieldType(0);

if(sType=="字符型")

{

sSmallCaption=CharToLetterCode(m_GxDataBaseName);

sSmallCaption=sSmallCaption.Left(2);

NewNumber=ado.AutoNumber(m_GxDataBaseName,m_GxIdentify,sSmallCaption,m_GxN umberStyle);

}

else

NewNumber=ado.AutoNumber(m_GxDataBaseName,m_GxIdentify,"",m_GxNumberStyle);

pEdt[0].SetWindowText(NewNumber);

pEdt[1].SetFocus();

}

void CDBaseDlg::OnButundo()

{

if(MessageBox("确定要撤销操作吗?","系统提示",MB_OKCANCEL|MB_ICONQUESTION)!=1)

return;

Clear();

Display();

Enabled(false);

}

void CDBaseDlg::OnButsave()

{

if(MessageBox("确定要保存记录吗?","系统提示",MB_OKCANCEL|MB_ICONQUESTION)!=1)

return;

RxRecordset rst;

rst.Open(m_GxDataBaseName);

将文本存入数组

CString sValue[50],sCaption[50],sType[50];

for(int i=0;i

{

sType[i]=rst.GetFieldType(i);

pEdt[i].GetWindowText(sValue[i]);

pSta[i].GetWindowText(sCaption[i]);

sCaption[i]=sCaption[i].Left(sCaption[i].GetLength()-1);

if(sValue[i].IsEmpty()==true && rst.IsNull(i)==true)

{

MessageBox("『"+sCaption[i]+"』字段不允许为空!","系统提示",MB_OK|MB_ICONSTOP);

pEdt[i].SetFocus();

return;

}

if(rst.GetFieldType(i)=="日期型")

{

if(IsTime(sValue[i])==false)

{

MessageBox("请输入正确的日期格式,如“1983-06-16”、“83616”等","系统提示",MB_OK|MB_ICONSTOP);

pEdt[i].SetFocus();

return;

}

}

}

组成新字符串

CString sValueString,str,sFiledString;

if(m_GxIsAdd==true)

{

sValueString="";

sFiledString="";

for(i=0;i

{

str="";

str=sValueString;

if(sType[i]=="数值型")

sValueString.Format("%s,%s",str,sValue[i]);

else

sValueString.Format("%s,'%s'",str,sValue[i]);

str="";

str=sFiledString;

sFiledString.Format("%s,%s",str,sCaption[i]);

}

}

else

{

sValueString="";

for(i=1;i

{

str="";

str=sValueString;

if(sType[i]=="数值型")

sValueString.Format("%s,%s=%s",str,sCaption[i],sValue[i]);

else

sValueString.Format("%s,%s='%s'",str,sCaption[i],sValue[i]);

}

}

sFiledString=sFiledString.Right(sFiledString.GetLength()-1);

CString sSQL;

if(m_GxIsAdd==true)

sSQL.Format("INSERT INTO %s (%s) V ALUES(%s)",m_GxDataBaseName,sFiledString,sValueString.Right(sValueString.GetLength()-1 ));

else

{

if(sType[0]=="数值型")

sSQL.Format("UPDATE %s SET %s WHERE %s=%s",m_GxDataBaseName,sValueString.Right(sValueString.GetLength()-1),sCaptio n[0],sValue[0]);

else

sSQL.Format("UPDATE %s SET %s WHERE %s='%s'",m_GxDataBaseName,sValueString.Right(sValueString.GetLength()-1),sCaptio n[0],sValue[0]);

}

if(rst.Open(sSQL,adCmdText)==false)

{

MessageBox("数据保存失败!","系统提示",MB_OK|MB_ICONSTOP);

pEdt[1].SetFocus();

return;

}

this->Enabled(false);

this->m_GxButCommand[1].SetFocus();

}

void CDBaseDlg::OnButexit()

{

this->OnCancel();

}

void CDBaseDlg::MoveButton(int x, int y)

{

CRect rcNew,rcOld,rcMem;

m_GxButCommand[0].GetClientRect(rcOld);

rcNew.left=x;

rcNew.top=y;

rcNew.right=rcNew.left+rcOld.Width()+10;

rcNew.bottom=rcNew.top+rcOld.Height()+5;

rcMem=rcNew;

for(int m=0;m<7;m++)

{

m_GxButCommand[m].MoveWindow(&rcNew,true);

rcNew.left=rcMem.right+3;

rcNew.right=rcNew.left+rcMem.Width();

rcMem=rcNew;

}

void CDBaseDlg::Enabled(bool bEnabled)

{

for(int i=1;i

pEdt[i].SetReadOnly(!bEnabled);

m_GxButCommand[0].EnableWindow(!bEnabled);

m_GxButCommand[1].EnableWindow(!bEnabled);

m_GxButCommand[2].EnableWindow(!bEnabled);

m_GxButCommand[3].EnableWindow(!bEnabled);

m_GxButCommand[4].EnableWindow(bEnabled);

m_GxButCommand[5].EnableWindow(bEnabled);

m_GxButCommand[6].EnableWindow(!bEnabled);

}

void CDBaseDlg::Clear()

{

for(int m=0;m

{

pEdt[m].SetWindowText("");

}

}

void CDBaseDlg::Display()

{

CString sItemValue;

int nSelectMark=m_GxpGrid->GetSelectionMark();

if(nSelectMark==-1)

{

m_GxButCommand[4].EnableWindow(true);

return;

}

for(int i=0;i

{

sItemValue=m_GxpGrid->GetItemText(nSelectMark,i);

pEdt[i].SetWindowText(sItemValue);

}

}

void CDBaseDlg::OnCancel()

{

if(m_GxButCommand[0].IsWindowEnabled()==false)

if(MessageBox("真的要不保存就退出吗?","系统提示",MB_OKCANCEL|MB_ICONQUESTION)!=1)

return;

::DeleteObject(pSta);

::DeleteObject(pEdt);

CDialog::OnCancel();

bool IsTime(CString sDate)

{

int nYear,nMonth,nDay,iFChar,iSChar;

CString sYear,sMonth,sDay;

取出“-”的位置

iFChar=sDate.Find("-",0);

if(iFChar==-1)

{

iFChar=sDate.Find("",0);

if(iFChar==-1)

return false;

else

{

iSChar=sDate.Find("",iFChar+1);

if(iSChar==-1)

return false;

}

}

else

{

iSChar=sDate.Find("-",iFChar+1);

if(iSChar==-1)

return false;

}

sYear=sDate.Left(iFChar);

sMonth=sDate.Mid(iFChar+1,iSChar-(iFChar+1));

sDay=sDate.Mid(iSChar+1);

if(sYear.GetLength()>4 || sMonth.GetLength()>2 || sDay.GetLength()>2) return false;

nYear=atoi(sYear);

nMonth=atoi(sMonth);

nDay=atoi(sDay);

if(nYear==0||nMonth==0||nDay==0|| nMonth>12 || nDay>31)

return false;

return true;

}

int Autoplace(CString sStoreID,bool IsRow)

{

RxRecordset aRst;

CString sSQL,sRow,sNum;

sSQL.Format("SELECT FROM 仓库信息表WHERE 编号=%s",sStoreID);

aRst.Open(sSQL,adCmdText);

if(aRst.GetRecordCount()<1)

return 0;

else 取出仓库的排数和号数

{

sRow=aRst.GetFieldValue("仓库排数");

sNum=aRst.GetFieldValue("每排号数");

}

int nNum=1,nRow=1;

while(true)

{

if(nNum==atoi(sNum))

{

nRow++;

nNum=1;

}

sSQL.Format("SELECT FROM 库存信息表WHERE 货位_排=%d AND 货位_号=%d AND 仓库编号=%s",nRow,nNum,sStoreID);

aRst.Open(sSQL,adCmdText);

if(aRst.GetRecordCount()<1)

break;

nNum++;

}

if(IsRow==true)

return nRow;

else

return nNum;

}

CDBaseDlg::~CDBaseDlg()

{

delete [] pEdt;

pEdt = NULL;

delete [] pSta;

pSta = NULL;

}

C源码Part Four

Machine generated IDispatch wrapper class(es) created by Microsoft Visual C++

NOTE: Do not modify the contents of this file. If this class is regenerated by

Microsoft Visual C++, your modifications will be overwritten.

#include "stdafx.h"

#include "vcdatapoints.h"

Dispatch interfaces referenced by this interface

#include "VcDataPoint.h"

CVcDataPoints properties

CVcDataPoints operations

long CVcDataPoints::GetCount()

{

long result;

InvokeHelper(0x1, DISPATCH_PROPERTYGET, VT_I4, (void)&result, NULL);

return result;

}

CVcDataPoint CVcDataPoints::GetItem(short Index)

{

LPDISPATCH pDispatch;

static BYTE parms[] =

VTS_I2;

InvokeHelper(0x0, DISPA TCH_PROPERTYGET, VT_DISPATCH, (void)&pDispatch, parms,

Index);

return CVcDataPoint(pDispatch);

}

C源码Part Five

DrawDlg.h: interface for the CDrawDlg class.

#if !defined(AFX_DRAWDLG_H__8CA9ACA2_3A59_4996_9DAD_124CFEE21CB0__INCLU DED_)

#define

AFX_DRAWDLG_H__8CA9ACA2_3A59_4996_9DAD_124CFEE21CB0__INCLUDED_

#if _MSC_VER > 1000

#pragma once

#endif _MSC_VER > 1000

class CPreView;

class CDrawDlg

{

public:

CDrawDlg();

virtual ~CDrawDlg();

int GetTotalChars()const;

int GetMaxPages() const;

virtual CListCtrl GetListCtrl()=0;

long CalcUnitWidth();

bool InitData(int xPix,int yPix,int ypixperi, CDC pDC, CPrintInfo pInfo, CListCtrl m_Gxlist);

bool InitData(CDC pDC, CPrintInfo pInfo,CListCtrl m_Gxlist);

void OnBeginPrinting(CDC pDC, CPrintInfo pInfo);

void PaintDlg(CDC pDC,CPrintInfo pInfo);

void DrawListItems(CDCpDC,int iCurPage,CPoint ptLeftCurPos,CPoint ptRightCurPos,CListCtrl m_GxpList);

void PrintPageHeader(CDC pDC, CPrintInfo pInfo,CString header);

void PrintPageFooter(CDC pDC, CPrintInfo pInfo);

virtual void PrintDlg(CDC pDC, CPrintInfo pInfo)=0;

virtual void PrintPageHeader(CDC pDC, CPrintInfo pInfo)=0;

int m_GxiMaxPages; 保存最大页码

int m_GxiMinPages; 保存最小页码

int m_GxiFontHeight; 字高==16 inch

int m_GxiHeadHeight; 标题高==12 inch

int m_GxiFootHeight; 页脚高==12 inch

int m_GxiLeftMargin; 左边距

int m_GxiRightMargin; 右边距

int m_GxiLineHeight; 行高==13 inch

int m_GxiLinesPage; 可容纳的行数(包括页眉,页脚)

int m_GxiLinesTotal; 页眉占两行

CSize m_GxrangePageItems; 每页显示的行数(from x to y);

CFont m_GxpOldFont;

CFont m_GxpGeneralFont;

CFont m_GxpHeadFont; 字高==13 inch

CFont m_GxpFootFont; 字高==16 inch

int m_GxnColumns; 列数

int m_GxiHaveColumnsTitle;是否每页有列标题

int m_GxnSmallTilte; 小标题的行数例如:日期,编号......

CString m_GxpstrColumnTitle; 每列标题

int m_GxpiCharsColumns; 每列最大的字符数

int m_GxpiWidthColumns; 每列宽度

int m_GxiTitleLines; 标题占的行数

int m_GxiFootLines; 页脚站的行数

};

#endif !defined(AFX_DRAWDLG_H__8CA9ACA2_3A59_4996_9DAD_124CFEE21CB0__I NCLUDED_)

C++工资管理系统源代码

C++工资管理系统源代 码 Document number【AA80KGB-AA98YT-AAT8CB-2A6UT-A18GG】

#define TITLE "\n 月份工号姓名应发工资各种折扣实发工资\n" #define DATA " %2d %4ld %-10s % % %\n",p1->month,p1- >num,p1->name,p1->should_pay,p1->rebate,p1->actual_pay typedef struct pay { long num; short month; char name[20]; float gw,jn,zw,zl,jt,yj; float should_pay; float fz,gj,sd,others; float rebate; float actual_pay; struct pay *next; }PAY;

FILE *fp; PAY *p1=NULL,*p2=NULL,*head=NULL; void menu(); PAY *input(); void output(); void save(PAY *head); PAY *open(); PAY *insert(); void search(); PAY *del(); PAY *revise(); /*主程序模块*/ void main(void) { short sel; do

{ menu(); scanf("%d",&sel); switch(sel) { case 1: head=input(); 建工资档案\n"); printf("\t\t\t\t2.新增工资信息\n"); printf("\t\t\t\t3.修改工资信息\n"); printf("\t\t\t\t4.删除工资信息\n"); printf("\t\t\t\t5.查找工资信息\n"); printf("\t\t\t\t6.分类信息列表\n"); printf("\t\t\t\t7.保存信息\n"); printf("\t\t\t\t0.退出\n"); printf("\n\n\n\n\n\n\n\n"); }

员工工资管理系统源代码样本

#include #include typedef struct { int basic;//基本工资 int position;//岗位工资 int subsidy;//津贴 int wages;//奖金 int sum;//总工资 }money; typedef struct { char num[20];//职工号 char name[20];//姓名 int age;//年龄 char sex[20];//性别 money salary;//工资 }employee; int Print_jinru();//账号密码输入 void Fscan_information();//”职工信息.txt”文件写入

void Print_staff();//全体员工 void Print_empl1(char x[51]);//按职工号查询 void Print_empl2(char s[51]);//按姓名查询 void Print_MainInterface();//主界面 void Print_Interface_1();//职工信息录入界面 void Print_Interface_2();//职工信息查询界面 void Print_Interface_3();//职工工资排序界面 void Print_Interface_4();//职工总工资 void Print_Interface_5();//文件读出 void qsort(int l,int r);//快速排序 void Print_delete(int t);//删除职工信息 void Print_Interface_2_1(int t);//职工信息修改界面 int fyanzheng(char s1[],char s2[]);//密码验证函数employee st[500];//记录职工信息的函数 int n;//职工总数 void main() { int x; employee em; printf("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@\n");

C员工工资管理系统源代码

C员工工资管理系统源代码

#include #include #include #include #include #include using namespace std; #define NULL 0 #define LEN sizeof(struct student) int const N=20; void Menu(); void Pass(); int n=0; //定义一个全局变量统计职工人数//——--------->定义一个职工信息的结构体 struct student { char name[N]; //用来存放姓名 char sex[N]; //用来存放性别 long id; //用来存放编号 float paid[3]; //用来存放工资 int total; //用来存放总工资 struct student *next;

}; //-------------->职工类 class Information { public: Information() ; //构造函数. ~Information() ; //析构函数. student *creat(); //建立链表 void output(student *head); //显示职工信息 int count(student *head); //定义函数count()统计职工总数student *insert(student*head); //指针函数*insert()用来添加职工信息. student *cancel(student *head,long id); //指针函数*cancel()用来删除职工信息. student *find(student *head,long id); //指针函数*find()用来查找职工信息. student *modify(student *head,long id); //指针函数*modife()用来修改职工的信息. void paixu(student *head); //定义paixu()函数将职工的总额从大到小排列并输出 void average(student *head); //定义职工工资平均值的函数void save(student *head); //保存文件信息

c语言工资管理系统课程设计

程序设计课程设计报告 工资管理系统 院系:地质工程系 班级:地质工程班 组员:陈欣永 胡世俊 李积荣赵海俊 马小成

目录 一、设计目的 (1) 二、设计内容与要求 (2) 1.设计内容 (3) 2.设计要求 (4) 三、总流程图设计 (5) 四、程序详细功能设计 (6) 五、程序调试 (7) 六、设计小结 (8) 七、参考文献 (9) 附录 (10) 1

一、设计目的 在计算机中建立相应的数据结构,利用程序实现工资的输入、查询、增、删、改、统计、输出等操作。 进一步掌握利用C语言进行程序设计的能力;进一步理解和运用结构化程序设计的思想和方法;初步掌握开发一个小型实用系统的基本方法;学会调试一个较长程序的基本方法;学会利用流程图表示算法。 《工资管理系统》的设计与实现,此次程序设计主要利用c语言的基础知识开发一个简单的职工工资管理系统。工资管理系统是一个企业不可缺少的一部分,它利用计算机对职工工资进行统一管理,实现工资管理工作的系统化、规范化和自动化,为企业提高工作效率。 二、设计内容与要求

1.设计内容 主要利用c语言的文件操作能力设计开发一个小型的管理信息系统,至少具有如下功能:对职工信息的录入、修改或删除,通过职工姓名或工号进行查找,并逐项列出相信的职工工资信息,另外也可以查看所有职工目前的工资状况。有一个文本菜单来调用各个功能的函数及一个主菜单来提示用户如何操作。 2.设计要求 在计算机中建立相应的数据结构,利用程序实现工资的输入、查询、增、删、改、统计、输出等操作。 三、总体流程图设计 3

四、程序详细功能设计 1、设计一个能够记录公司职工工资的数据结构,每条记录包括:职工号,姓名,基本工资,职务工资,津贴。 2、应用文件保存工资管理数据。 3、新增:能将所有输入的职工工资数据保存到文件中,并可选择继续输入或退出。

小型公司工资管理系统(C)源代码

#include #include #include #include class Employ// 基类- 雇员类{ protected: int num; char name[10]; char sex; int age; int wage; public: virtual void set()=0; virtual void print()=0; virtual void reserved()=0; }; class Manager:public Employ// 经理类 { public: void set(); void print(); void reserved(); }; class Salesman:public Employ// 销售员类{ protected: int salesvolume; int snum; public: void set(); void print(); void reserved(); void printinfor(); int getsales() {return salesvolume;} int getsnum() {return snum;} };

class MarketMan:public Manager// 销售经理类{ protected: int salesvolume; public: void set(); void print(); void reserved(); int resetwage(); int getnum() {return num;} char*getname() {return name;} int getamount(Salesman s[],int n) { salesvolume=0; for(int i=0;i>num; cout<<" 其姓名:"; cin>>name; cout<<" 性别(m/w):"; cin>>sex; cout<<" 年龄:";

c语言工资管理系统课程设计

程序设计课程设计报告工资管理系统 院系:地质工程系 班级:地质工程班 组员:陈欣永胡世俊 李积荣赵海俊 马小成

目录 一、设计目的 (1) 二、设计内容与要求 (2) 1.设计内容 (3) 2.设计要求 (4) 三、总流程图设计 (5) 四、程序详细功能设计 (6) 五、程序调试 (7) 六、设计小结 (8) 七、参考文献 (9) 附录 (10)

一、设计目的 在计算机中建立相应的数据结构,利用程序实现工资的输入、查询、增、删、改、统计、输出等操作。 进一步掌握利用C语言进行程序设计的能力;进一步理解和运用结构化程序设计的思想和方法;初步掌握开发一个小型实用系统的基本方法;学会调试一个较长程序的基本方法;学会利用流程图表示算法。 《工资管理系统》的设计与实现,此次程序设计主要利用c语言的基础知识开发一个简单的职工工资管理系统。工资管理系统是一个企业不可缺少的一部分,它利用计算机对职工工资进行统一管理,实现工资管理工作的系统化、规范化和自动化,为企业提高工作效率。

二、设计内容与要求 1.设计内容 主要利用c语言的文件操作能力设计开发一个小型的管理信息系统,至少具有如下功能:对职工信息的录入、修改或删除,通过职工姓名或工号进行查找,并逐项列出相信的职工工资信息,另外也可以查看所有职工目前的工资状况。有一个文本菜单来调用各个功能的函数及一个主菜单来提示用户如何操作。 2.设计要求 在计算机中建立相应的数据结构,利用程序实现工资的输入、查询、增、删、改、统计、输出等操作。 三、总体流程图设计

四、程序详细功能设计 1、设计一个能够记录公司职工工资的数据结构,每条记录包括:职工号,姓名,基本工资,职务工资,津贴。 2、应用文件保存工资管理数据。 3、新增:能将所有输入的职工工资数据保存到文件中,并可选择继续输入或退出。

c语言课程设计职工工资管理系统源代码

绝对可以完美运行,下面有运行图片 #include //调用库函数 #include //字符串处理 #include //控制台输入输出 #include //定义杂项函数及内存分配函数 #define N 2 //宏定义以3代替N /****************************************************************************** 函数声明 *******************************************************************************/ void enter(); int menu(); void input(); void output(); void search(); void search_employeeid(); void search_name(); void edit(); void array(); void array_basesalary(); void array_postwage(); void array_totalwage(); void statistics(); void save(); void load(); /****************************************************************************** 职工类型定义 *******************************************************************************/ struct employee { char employeeid[10]; char name[10]; char sex[10]; int age; float basesalary; float postwage; float totalwage;

工资管理系统源代码

#include #include #include #include #include #define MONTH_NUM 5 /* 最多的月份*/ struct worker { int number; /* 每个工人的工号*/ char name[15]; /* 每个工人的姓名*/ int salary[MONTH_NUM]; /* 每个工人M月的工资*/ int sum; /* 每个工人的总工资*/ float average; /* 每个工人的平均工资*/ struct worker *next; //下一个节点的地址 }; typedef struct worker STU; char Menu(void); int Ascending(int a, int b); int Descending(int a, int b); void IntSwap(int *pt1, int *pt2); void CharSwap(char *pt1, char *pt2); void FloatSwap(float *pt1, float *pt2); STU *AppendNode(STU *head, const int m); STU *DeleteNode(STU *head, int nodeNum); STU *ModifyNode(STU *head, int nodeNum, const int m); STU *SearchNode(STU *head, int nodeNum); STU *Appendsalary(STU *head, const int m);

C工资管理系统源代码

C工资管理系统源代码Newly compiled on November 23, 2020

#include <> #include <> #include <> #include <> #include <> #define TITLE "\n 月份工号姓名应发工资各种折扣实发工资\n" #define DATA " %2d %4ld %-10s % % %\n",p1->month,p1->num,p1->name,p1->should_pay,p1->rebate,p1->actual_pay typedef struct pay { long num; short month; char name[20]; float gw,jn,zw,zl,jt,yj; float should_pay; float fz,gj,sd,others; float rebate; float actual_pay; struct pay *next; }PAY; FILE *fp; PAY *p1=NULL,*p2=NULL,*head=NULL; void menu(); PAY *input(); void output(); void save(PAY *head); PAY *open(); PAY *insert(); void search(); PAY *del(); PAY *revise(); /*主程序模块*/ void main(void) { short sel; do { menu(); scanf("%d",&sel); switch(sel) { case 1:

工资管理系统C编程实验报告

—— 《C++程序设计》课程综合实习实习题目:工资管理系统 系别:计算机系 ___ 专业:计算机与科学 班级: 姓名: 学号: 指导教师: 日期: 2015年12月27日_

目录

一、课程实习的题目、任务与要求 1.课程实习的题目 工资管理系统 2.课程实习内容 (1)存储的数据包括:员工号,姓名,基本工资,补贴金额,奖励金额,扣除金额、实发工资等)。实发工资=基本工资+补贴金额+奖励金额-扣除金额。 (2)按职工号增加、删除、修改记录功能; (3)查询功能,包括按姓名、职工号查询; (4)排序功能,按指定的关键字(如职工号、姓名、实发工资)排序。 3.课程实习的要求 根据C++课程所学的概念、理论和方法,按照C++程序设计的基本步骤,设计出一个适当规模的程序来实现设计课程内容中的全部功能;设计主控模块程序,对给出的程序源代码要给出各部分的详细注释.自己根据能力及需要添加相应功能模块,增强模拟系统功能。包括系统的功能分析、系统的功能模块设计、程序流程图或结构框图、逻辑结构设计等。 二、系统分析 1.需求分析 a.能对员工工资信息进行录入。 b.能对员工工资信息进行增加。 c.能对员工工资进行删除。 d.能对员工工资进行修改。 e.能对员工按实发工资,姓名,进行查询。 f.能输出员工工资的所有数据。 g.能对员工工资信息按实发工资、员工号进行排序。

2.系统性能要求 a.系统安全、可靠; b.功能齐全; c.操作方便、界面友好; d易于维护和扩充。 3.系统的功能分析 资料维护:系统维护包括对员工工资信息的录入操作及数据表中的信息进行浏览。系统功能:可以对数据表中的信息进行浏览。 系统查询:可以对员工工资信息进行查询。 4.系统功能模块 员工查询系统有:工资信息录入、增加、删除、修改,数据查询,排序显示构成。 5.模块框架图

C++员工工资管理系统源代码

#include #include #include #include #include #include using namespace std; #define NULL 0 #define LEN sizeof(struct student) int const N=20; void Menu(); void Pass(); int n=0; //定义一个全局变量统计职工人数 //——--------->定义一个职工信息的结构体 struct student { char name[N]; //用来存放姓名 char sex[N]; //用来存放性别 long id; //用来存放编号 float paid[3]; //用来存放工资 int total; //用来存放总工资 struct student *next; }; //-------------->职工类 class Information { public: Information() ; //构造函数. ~Information() ; //析构函数. student *creat(); //建立链表 void output(student *head); //显示职工信息 int count(student *head); //定义函数count()统计职工总数 student *insert(student*head); //指针函数*insert()用来添加职工信息. student *cancel(student *head,long id); //指针函数*cancel()用来删除职工信息. student *find(student *head,long id); //指针函数*find()用来查找职工信息. student *modify(student *head,long id); //指针函数*modife()用来修改职工的信息. void paixu(student *head); //定义paixu()函数将职工的总额从大到小排列并输出 void average(student *head); //定义职工工资平均值的函数 void save(student *head); //保存文件信息 student *Read(); //读取文件信息 private:

c语言教师工资管理系统

C语言程序设计 课程设计报告设计题目:教师工资管理系统 班级 学号 姓名 指导教师 起止时间2010-10-26 至2010-12-26

设计任务 该系统包含教师的基本信息,供读者查询。建立一个文件,包括老师的信息,包括:教师号、姓名、性别、单位名称、家庭住址、联系电话、基本工资、津贴、生活补贴、应发工资、电话费、水电费、房租、所得税、卫生费、公积金等。读者可以输入教师信息、插入教师信息、删除教师信息、浏览教师信息、查询教师信息和修改教师信息。同时读者可以将之前录入的教师信息保存下来,然后关闭程序后,再次打开后只需加载教师信息就可以了。更加方便以后程序。 评语(教师填写)

目录 设计任务 (2) 评语(教师填写) (2) 1.课程设计目的 (4) 2.课程设计题目 (5) 3.功能描述 (6) 4.数据结构设计 (8) 5.功能模块设计 (10) 5.1主控模块设计 (10) 5.2 输入记录模块 (11) 5.3 插入记录模块 (11) 5.4 删除记录模块 (12) 6.函数功能描述 (13) 6.1 保存数据函数save() (13) 6.2 查询数据函数query() (13) 6.1修改数据函数edit() (14) 6.1 加载数据函数load() (15) 7.运行结果 (112) 7.1系统主界面 (112) 7.2 输入教师信息界面 (16) 7.3 输出教师信息界面 (18) 7.4 插入教师信息界面 (19) 7.5 保存和加载教师信息界面 (20) 8.个人设计小结与心得体会 (21) 参考文献 (22)

1.课程设计目的 本程序旨在训练基本编程能力,了解管理信息系统的开发流程,熟悉C 语言的文件和结构数组的各种基本操作。本程序涉及结构体、数组、指针、文件等方面的知识。通过本程序的训练,使读者能对C语言的文件操作有一个更深刻的了解,掌握利用数组存储结构实现教师工资管理系统,为进一步开发出高质量信息管理系统打下坚实的基础。 (1)巩固和加强《C语言程序设计》课程的理论知识。 (2)掌握C语言的基本概念、语法、语义和数据类型的使用特点。 (3)掌握C语言程序设计的方法及编程技巧,能正确使用C语言编写程序。 (4)进一步理解和运用结构化程设计的思想和方法;学会利用流程图表示算法。 (5)掌握调试程序的基本方法及上机操作方法。 (6)掌握书写程设计开发文档的能力,学会撰写课程设计总结报告。课程设计的思想和方法还可以作为毕业论文时的参考资料。 (7)通过查阅手册和文献资料,培养自己独立分析问题和解决问题的能力。为自己做毕业设计打好基础。 (8)初步掌握开发一个小型实用系统的基本方法:结合实际应用的要求,使课程设计既覆盖知识点,又接近工程实际需要。通过激发学习兴趣,调动自己主动学习的积极性,并根据实际编程要求,训练自己实际分析问题的能力及编程能力,并养成良好的编程习惯。 (9)培养自己的创新能力和创新思维。可以根据指导书和相关文献上的参考算法,自己设计出相应的应用程序。 (10)培养自己良好的程序设计风格。在实际编程中,为了提高编程质量,对空行、空格和注释均有要求。自己在课程设计书写代码时,应该严格

C++课程设计 职工工资管理系统(报告内含程序完整清单)

目录 目录 (i) 1概述 (1) 1.1程序的基本功能 (1) 1.2其它功能 (1) 1.3扩展功能 (1) 2课题的分析 (2) 2.1会员登入系统模块即SYSTEMHEAD静态全局函数模块 (2) 2.2查询功能模块即SEARCH函数模块 (2) 2.3职务信息匹配及处理模块即SYSTEMBODY静态全局函数模块模块4 (2) 2.4循环控制模块即WHILE(1)模块 (2) 3详细设计 (3) 3.1类声明 (3) 3.2系统简略流程图 (4) 3.3会员登入系统模块即SYSTEMHEAD静态全局函数模块 (5) 3.4查询功能模块即SEARCH函数模块 (6) 3.5职务信息匹配及处理模块即SYSTEMBODY静态全局函数模块 (7) 3.6循环控制模块即WHILE(1)模块 (7) 4课程设计总结 (8) 4.1完成情况 (8) 4.2遇到的问题及解决 (8) 参考文献 (10) 附录 (11)

1 概述 本课程设计是《面向对象程序设计》课程的后继教学环节,学好C++语言就必须坚持用面向对象的思维方式分析问题、解决问题,最好的方法是仿照教材编写C++实际应用程序。 此次课程设计的题目及要求:实现一个简单的工资管理系统。 1.1 程序的基本功能 系统的主要功能是计算职工当月工资并存档。公司内有5种不同类型的职工:技术人员、销售人员、文秘、技术经理和销售经理,他们的工资计算方式各不相同。 1.2 其它功能 将工资信息存入salary.txt文件中,工资信息包含雇员编号、姓名、职务、月份、月收入。 Info.txt文件中只存留一些信息及会员最后进入系统时输入的数据,最多含有编号、姓名、职务、月份的信息。 1.3 扩展功能 采用了会员制度,并将登入信息及编号、密码存入number.txt文件中。

C++员工工资管理系统源代码

C++员工工资管理系统源代码

#include #include #include #include #include #include using namespace std; #define NULL 0 #define LEN sizeof(struct student) int const N=20; void Menu(); void Pass(); int n=0; //定义一个全局变量统计职工人数 //——--------->定义一个职工信息的结构体 struct student { char name[N]; //用来存放姓名 char sex[N]; //用来存放性别 long id; //用来存放编号 float paid[3]; //用来存放工资

int total; //用来存放总工资 struct student *next; }; //-------------->职工类 class Information { public: Information() ; //构造函数. ~Information() ; //析构函数. student *creat(); //建立链表 void output(student *head); //显示职工信息 int count(student *head); //定义函数count()统计职工总数 student *insert(student*head); //指针函数*insert()用来添加职工信息. student *cancel(student *head,long id); //指针函数*cancel()用来删除职工信息. student *find(student *head,long id); //指针函数*find()用来查找职工信息. student *modify(student *head,long id); //指针

教师工资管理系统程序代码

1.实发工资=应发工资-扣款-税费。根据应发工资,1000元以 内的不扣税,1000-2000扣税超出1000元部分的5%,2000-3000元再扣超出2000元部分的10%,超过3000元的都扣除超出3000元部分的15%。确定信息的数据结构: structSalary_type {charname[20]; charnum[10]; floatjbgz; floatyfgz; floatkoukuan; floatshuifei; floatsfgz; structsalary*prior; structsalary*next; }Salary[N]; 2.程序应具有以下基本功能: 添加:添加一个或几个的记录,并可选择继续输入或退出。 查询:可按姓名或工号查找记录,若找到,则显示其记录,否 则提示未找到,无论查找成功与否,应还可选择继续查找或退 出。 删除:删除记录。先查找需要删除的记录,如找到,则删除该 记录,可添加提示,选择确认后删除,否则可以取消该操作; 如果查找失败,则返回没有此记录。 修改:修改记录。输入姓名并查找,若找到,显示该姓名的所 有信息,并可进行修改;否则提示无此信息。 设计要求:

1.核心数据结构用到的结构体要采用动态内存分配和链表结构。 家庭住址也要求存储在动态分配的内存中,以节约内存。内存的起始地址存储在结构体的成员指针addr中。 2.使用文件进行存储和管理。程序启动时可从文件中读取通信信息,或从键盘输入通信信息;运行过程中如添加或删除记录时也可对文件进行存取;退出前可选择将通信信息保存到文件中。 3.不同的功能使用不同的函数实现(模块化),对每个函数的功能和调用接口要注释清楚。对程序其它部分也进行必要的注释。 2011-4-222:57最佳答案#include #include #include typedefstructSalary_type { charname[20]; charnum[10]; //floatjbgz; floatyfgz;//应发工资 floatkoukuan;//扣款 floatshuifei;//税费 floatsfgz;//实发工资 structSalary_type*prior; structSalary_type*next; }salary,*Salary; floattaxpay(floatsalary) { floattaxpayment;

人事管理系统C源代码

#include "stdio.h" /*标准输入输出函数库*/ #include "stdlib.h" /*标准函数库*/ #include "string.h" /*字符串函数库*/ #include "conio.h" /*屏幕操作函数库*/ #define HEADER1 " -------------------------------RSDA---------------------------------------- \n" #define HEADER2 "| number| name | jbgz | jj | kk | yfgz | sk | sfgz | \n" #define HEADER3 "|--------|-----------|--------|--------|--------|--------|--------|--------| \n" #define FORMAT "|%-8s|%-10s |%8.2f|%8.2f|%8.2f|%8.2f|%8.2f|%8.2f| \n" #define DATA p->num,p->name,p->jbgz,p->jj,p->kk,p->yfgz,p->sk,p- >sfgz #define END "---------------------------------------------------------------------------- \n" #define N 60 int saveflag=0; /*是否需要存盘的标志变量*/ /*定义与职工有关的数据结构*/ typedef struct employee /*标记为employee*/ { char num[10]; /*职工编号*/ char name[15]; /*职工姓名*/ float jbgz; /*基本工资*/ float jj; /*奖金*/ float kk; /*扣款*/ float yfgz; /*应发工资*/ float sk; /*税款*/ float sfgz; /*实发工资*/ }RSDA; void menu() /*主菜单*/ { system("cls"); /*调用DOS命令,清屏.与clrscr()功能相同*/ printf(" The Employee Management System \n"); printf(" *************************Menu********************************\n"); printf(" * 1 input record 2 delete record *\n");

c语言课程设计职工工资管理系统源代码

c语言课程设计职工工资 管理系统源代码 Prepared on 22 November 2020

绝对可以完美运行,下面有运行图片 #include<> otalwage=p[c].basesalary+p[c].postwage; printf(" 请输入第%d个职工信息:\n\n",c+1); printf(" 请输入职工号:\n"); scanf("%s",p->employeeid); if(strcmp(p->employeeid,"0")!=0) { printf(" 请输入职工姓名:\n"); scanf("%s",p->name); printf(" 请输入职工性别: \n"); scanf("%s",&p->sex); printf(" 请输入职工年龄: \n"); scanf("%d",&p->age); printf(" 请输入职工基本工资:\n"); scanf("%f",&p->basesalary); printf(" 请输入职工岗位工资:\n"); scanf("%f",&p->postwage); printf(" 职工信息输入完成! \n\n"); } else return; } save(); } /*************************************************************************** **** 功能:职工信息输出 **************************************************************************** ****/ void output() { int j; load(); p=emp; printf(" 进入职工信息输出模块 \n\n\n"); printf("-------------------------------------------------------------------------------\n"); printf("| 职工号 |姓名 |性别 |年龄 |基本工资 |岗位工资 |总工资 |\n"); printf("-------------------------------------------------------------------------------\n"); for(j=0;j

C++员工工资管理系统源代码

void average(student *head); void save(student *head); student *Read(); private: //定义职工工资平均值的函数 //保存文件信息 //读取文件信息#include #include #include #include #include #include using namespace std; #define NULL 0 #define LEN sizeof(struct student) int const N=20; void Menu(); void Pass(); int n=0; // 定义一个全局变量统计职工人数 //—— ---- > 定义一个职工信息的结构体 struct student { char name[N]; char sex[N]; long id; float paid[3]; int total; //用来存放姓名 //用来存放性别 //用来存放编号 //用来存放工资 //用来存放总工资 struct student *next; }; > 职工类 class Information { public: Information() ; ~Information() ; student *creat(); // //构造函数 . //析构函数 . //建立链表 void output(student *head); int count(student *head); student *insert(student*head); //显示职工信息 //定义函数 count() 统计职工总数 // 指针函数 *insert() 用来添加职工信息 . student *cancel(student *head,long id); student *find(student *head,long id); student *modify(student *head,long id); void paixu(student *head); 出 //指针函数 *cancel() 用来删除职工信息 . //指针函数 *find() 用来查找职工信息 . //指针函数 *modife() 用来修改职工的信息 . //定义 paixu() 函数将职工的总额从大到小排列并输

相关文档
最新文档