DingFeilingVc + + course certificate.docx
- 文档编号:10602806
- 上传时间:2023-02-21
- 格式:DOCX
- 页数:19
- 大小:79.11KB
DingFeilingVc + + course certificate.docx
《DingFeilingVc + + course certificate.docx》由会员分享,可在线阅读,更多相关《DingFeilingVc + + course certificate.docx(19页珍藏版)》请在冰豆网上搜索。
DingFeilingVc++coursecertificate
课程设计(论文)任务书
SoftwareSchool College SoftwareEngineer Major 2007-2 Class
一、CourseDesign(Paper)Title Calculator
二、CourseDesign(Paper)Startform3rdJan2011to7thJan2011
三、CourseDesign(Paper)Address:
CreativeBuilding,TrainingCenterofSoftwareSchool
四、CourseDesign(Paper)Specifications:
1.TheAimoftheCourseDesign
MasterVCinterfacedesignandconsolidateC++basicknowledge
2.TheRequirementsoftheCourseDesign
1)BasicRequirements:
UsingMFCeditorandtheC++basicknowledge
2)OtherRequirements:
Toperformsimpleadd,subtract,multiplyanddivideoperation
3)TheRequirementsofthePaper
(1)Thepapershouldincludes:
sourcecodesystemstudyscreenshot
(2)Writeandprintthepaperaccordingtotheformat.
4)AssessmentDetails:
(1)Analysis:
20marks;
(2)Design&Development:
50marks;
(3)Test:
10marks;
(4)OralExamination:
20marks。
5)References:
1.”TheachYourselfVisualC++6in21Days”bySams
2.”C++Study”byTanHaoqiang
3.”VC++MFCExtensionsbyExample”byJohnE.Swanke
6)TheDailySchedule
TasksDays Address
ResearchandAnalysis1 Library
DesignandTest2.5 Lab
WritePaper1.5 Library、Lab
StudentSignature:
7thJan2011
课程设计(论文)评审意见
(1)Analysis(20marks):
Excellent(),Good(),Satisfactory(),Unsatisfactory(),Poor();
(2)Design&Development(20marks):
Excellent(),Good(),Satisfactory(),Unsatisfactory(),Poor();
(3)Test (20marks):
Excellent(),Good(),Satisfactory(),Unsatisfactory(),Poor();
(4)Translation (20marks):
Excellent(),Good(),Satisfactory(),Unsatisfactory(),Poor();
(5)OralExamination (20marks):
Excellent(),Good(),Satisfactory(),Unsatisfactory(),Poor();
(6)Whetherreducetoalowerrankbecauseoftheattendanceorpaper’sformat:
Yes(),No()
TeacherSignature:
thJan2011
Content
Content-3-
SystemStudy-4-
Screenshot-5-
SourceCode-8-
References-23-
SystemStudy
The“calculator”isasimpleprojectinVC++.Itusedthebasiccontrolslikebuttons.
Whenyoustarttheprogram,youcanseenineteenbuttonsandtextfileonthetopofthewindow.Therearedifferentwordsonthebuttonssuchas“o”.Onceyouclickedonebutton,aresultwouldbeshowonthetextfile.Ifyouclickedthe“1”button,1wouldappear,thenyouclickedthe“+”button,thenyouclickedthe“2”button,2wouldapplear,thenyouclickthe“=”button,3wouldapplear,andsoon.
Finishingthisproject,wecanlearnhowtobuildan
applicationinVC++,howtousethebasiccontrolsandhowtodealwiththemouseevents.
Screenshot
1.Themaininterfaceofthe“OnTheButtonWithDrawingShapes”
2.Clickedthe“39”button
3.Clickedthe“+”button
4.Clickedthe“29”button
5.Clickedthe“=”button
SourceCode
Appendix1:
structuraldesignsourceprogramlist
//filename:
AdvButton.cpp
//programfunction:
toachievehighbuttoncontrolclass.
//constructor
CAdvButton:
:
CAdvButton()
{
//initializationm_ClientRect
m_ClientRect.left=0;
m_ClientRect.top=0;
m_ClientRect.right=0;
m_ClientRect.bottom=0;
m_ClientRgn.DeleteObject();
m_ClientRgn.CreateEllipticRgnIndirect(&m_ClientRect);
m_State=0;
m_Point.x=m_Point.y=0;
m_IsTimerOn=FALSE;
}
BOOLCAdvButton:
:
Create(LPCTSTRlpszCaption,DWORDdwStyle,constRECT&rect,CWnd*pParentWnd,UINTnID)
{
returnCButton:
:
Create(lpszCaption,dwStyle,rect,pParentWnd,nID);
}
voidCAdvButton:
:
OnLButtonUp(UINTnFlags,CPointpoint)
{
//TODO:
Addyourmessagehandlercodehereand/orcalldefault
CRectrect;
GetWindowRect(&rect);
GetCursorPos(&m_Point);
if((rect.PtInRect(m_Point))&&(m_State!
=1))
{
m_State=1;//1:
focusstate
Invalidate();
}
CButton:
:
OnLButtonUp(nFlags,point);
}
voidCAdvButton:
:
OnTimer(UINTnIDEvent)
{
//TODO:
Addyourmessagehandlercodehereand/orcalldefault
CRectrect;
GetWindowRect(&rect);
GetCursorPos(&m_Point);
if(rect.PtInRect(m_Point))
{
if((m_State!
=1)&&(m_State!
=2))
{
m_State=1;
Invalidate();
}
}
else
{
if(m_State!
=0)
{
m_State=0;
Invalidate();
}
KillTimer(nIDEvent);
m_IsTimerOn=FALSE;
}
CButton:
:
OnTimer(nIDEvent);
}
voidCAdvButton:
:
DrawItem(LPDRAWITEMSTRUCTlpDrawItemStruct)
{
//getclientrect
GetClientRect(&m_ClientRect);
m_ClientRgn.DeleteObject();
m_ClientRgn.CreateEllipticRgnIndirect(&m_ClientRect);
SetWindowRgn(m_ClientRgn,FALSE);
CDC*pDC=CDC:
:
FromHandle(lpDrawItemStruct->hDC);
CPen*pPen=NULL;
switch(m_State)
{
case0:
pPen=newCPen(PS_SOLID,1,DefaultColor);
break;
case1:
pPen=newCPen(PS_SOLID,1,FocusColor);
break;
case2:
pPen=newCPen(PS_SOLID,1,SelectColor);
break;
case3:
pPen=newCPen(PS_SOLID,1,DesiableColor);
break;
}
pDC->SetBkMode(TRANSPARENT);
pPen=pDC->SelectObject(pPen);
pDC->Ellipse(&m_ClientRect);
pPen=pDC->SelectObject(pPen);
if(pPen)deletepPen;
LPTSTRpCaption=newchar[MAXCAPTIONLEN];//
intiLen=GetWindowText(pCaption,MAXCAPTIONLEN);
pDC->SetTextColor(TextColor);
pDC->DrawText(pCaption,iLen,&m_ClientRect,DT_SINGLELINE|DT_CENTER|DT_VCENTER);
}
Appendix2:
theobject-orienteddesignsourceprogramlist
//Filename:
CAdvEdit.cpp
//Programfunction:
Realizingtheadvancededitingcontrolclass
//Draweditcontroloftheclientarea
voidCAdvEdit:
:
OnDraw()
{
CRectrect;
GetClientRect(&rect);
CDC*pDC=GetDC();
pDC->SetBkMode(TRANSPARENT);
CBrush*pBrush=newCBrush(RGB(255,255,255));
pDC->FillRect(&rect,pBrush);
pDC->SetTextColor(RGB(92,92,92));
pDC->DrawText(m_Caption,rect,DT_SINGLELINE|DT_VCENTER|DT_RIGHT);
}
Appendix3:
object-orienteddesignsourceprogramlist
//Filename:
CalculatorDlg.cpp
//Programfunction:
realizedialoginterfacedesignandcalculatornumericalcomputationfunction
//Initializedialogfunctions
BOOLCCalculatorDlg:
:
OnInitDialog()
{
CDialog:
:
OnInitDialog();
m_Menu=newCMenu;//
m_Menu->LoadMenu(IDR_MENU);
SetMenu(m_Menu);
returnTRUE;//returnTRUEunlessyousetthefocustoacontrol
voidCCalculatorDlg:
:
OnExtend()
{
CRectrect;
GetWindowRect(&rect);
if(m_IsExtend)
{
GetWindowRect(&rect);
SetWindowPos(&wndTop,0,0,186,rect.Height(),SWP_NOMOVE|SWP_NOZORDER);
m_DspEdit.GetWindowRect(&rect);
m_DspEdit.SetWindowPos(NULL,rect.left,rect.top,155,rect.Height(),SWP_NOMOVE|SWP_NOZORDER);
m_DspStatic.GetWindowRect(&rect);
m_DspStatic.SetWindowPos(NULL,rect.left,rect.top,168,rect.Height(),SWP_NOMOVE|SWP_NOZORDER);
m_Menu->ModifyMenu(ID_EXTEND,MF_BYCOMMAND|MF_STRING,ID_EXTEND,"expansion");
m_IsExtend=FALSE;
}
else
{
SetWindowPos(&wndTop,0,0,330,rect.Height(),SWP_NOMOVE|SWP_NOZORDER);
m_DspEdit.GetWindowRect(&rect);
m_DspEdit.SetWindowPos(NULL,rect.left,rect.top,155,rect.Height(),SWP_NOMOVE|SWP_NOZORDER);
m_DspStatic.GetWindowRect(&rect);
m_DspStatic.SetWindowPos(NULL,rect.left,rect.top,168,rect.Height(),SWP_NOMOVE|SWP_NOZORDER);
m_Menu->ModifyMenu(ID_EXTEND,MF_BYCOMMAND|MF_STRING,ID_EXTEND,"standard");
m_IsExtend=TRUE;
}
voidCCalculatorDlg:
:
OnRad()
{
m_isDegree=1;
DtoR=1;
UpdateData(TRUE);
}
voidCCalculatorDlg:
:
OnDegree()
{
m_isDegree=0;
DtoR=(2*PI)/360;
UpdateData(FALSE);
}
voidCCalculatorDlg:
:
AdvButton1(
{
m_StrBegin=m_StrBegin+"1";
if(!
m_IsCheckPoint)
m_DspEdit.OnDisplay(m_StrBegin+".");
else
m_DspEdit.OnDisplay(m_StrBegin);
}
voidCCalculatorDlg:
:
AdvButton2()
{
m_StrBegin=m_StrBegin+"2";
if(!
m_IsCheckPoint)
m_DspEdit.OnDisplay(m_StrBegin+".");
else
m_DspEdit.OnDisplay(m_StrBegin);
}
voidCCalculatorDlg:
:
AdvButton3()
{
m_StrBegin=m_StrBegin+"3";
if(!
m_IsCheckPoint)
m_DspEdit.OnDisplay(m_StrBegin+".");
else
m_DspEdit.OnDisplay(m_StrBegin);
}
voidCCalculatorDlg:
:
AdvButton4()
{
m_StrBegin=m_StrBegin+"4";
if(!
m_IsCheckPoint)
m_DspEdit.OnDisplay(m_StrBegin+".");
else
m_DspEdit.OnDisplay(m_StrBegin);
}
voidCCalculatorDlg:
:
AdvButton5()
{
m_StrBegin=m_StrBegin+"5";
if(!
m_IsCheckPoint)
m_DspEdit.OnDisplay(m_StrBegin+".");
else
m_DspEdit.OnDisplay(m_StrBegin);
}
voidCCalculatorDlg:
:
AdvButton6()
{
m_StrBegin=m_StrBegin+"6";
if(!
m_IsCheckPoint)
m_DspEdit.OnDisplay(m_StrBegin+".");
else
m_DspEdit.OnDisplay(m_StrBegin);
}
voidCCalculatorDlg:
:
AdvButton7()
{
m_StrBegin=m_StrBegin+"7";
if(!
m_IsCheckPoint)
m_DspEdit.OnDisplay(m_StrBegin+".");
else
m_DspEdit.OnDisplay(m_StrBegin);
}
voidCCalculatorDlg:
:
AdvButton8()
{
m_StrBegin=m_StrBegin+"8";
if(!
m_IsCheckPoint)
m_DspEdit.OnDisplay(m_StrBegin+".");
else
m_DspEdit.OnDisplay(m_StrBegin);
}
voidCCalculatorDlg:
:
AdvButton9()
{
m_StrBegin=m_StrBegin+"9";
if(!
m_IsCheckPoint)
m_DspEdit.OnDisplay(m_StrBegin+".");
else
m_DspEdit.OnDisplay(m_StrBegin);
}
voidCCalculatorDlg:
:
Result()
{
m_IsCheckPoint=false;
m_begin=atof(m_StrBegin);
switch(m_bit)
{
case1:
m_end+=m_begin;
break;
case2:
m_end-=m_begin;
break;
case3:
m_end*=m_begin;
break;
case4:
if(m_begin==0)
{
m_DspEdit.OnDisplay("Divisorcannotbezero!
");
return;
}
m_end/=m_begin;
break;
case5:
if(m_end<0)
{
m_DspEdit.OnDisplay("Functioninputinvalid!
");
return;
}
m_end=sqrt(m_end);
break;
case6:
m_end=1/m_end;
case7:
break;
case8:
m_end=sin(m_end*DtoR);
break;
case9:
m_end=cos(m_end*DtoR);
break;
case10:
m_end=tan(m_end*DtoR);
break;
case11:
m_end=m_end*m_end;
break;
case12:
m_end=m_end*m_end*m_end;
break;
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- DingFeilingVc course certificate