《了解MIS的常用功能》实验报告.doc

上传人:飞****2 文档编号:52203303 上传时间:2022-10-21 格式:DOC 页数:33 大小:331.50KB
返回 下载 相关 举报
《了解MIS的常用功能》实验报告.doc_第1页
第1页 / 共33页
《了解MIS的常用功能》实验报告.doc_第2页
第2页 / 共33页
点击查看更多>>
资源描述

《《了解MIS的常用功能》实验报告.doc》由会员分享,可在线阅读,更多相关《《了解MIS的常用功能》实验报告.doc(33页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。

1、了解MIS的常用功能实验报告开课实验室:课外实践 2013 年 5月 12 日专业 工程管理班级工程管理1006学号P姓名欧丹成绩实验名称练习C1 利息计算练习C2 最优加工顺序练习C4 生成最小生成树; 练习C5 列车时刻表;练习C7 鱼口模拟;练习C6统计价格小于1000的产品数据。练习1.1利润计划编制实验项目了解MIS的常用功能指导教师李桂林一、实验目的了解MIS的常用功能;掌握各种MIS的操作方法。二、实验内容(1) 练习C6统计价格小于1000的产品数据。(2) 练习B1数据挖掘演示系统;(3) 练习C1 利息计算;(4) 练习C2 最优加工顺序;(5) 练习C4 生成最小生成树;

2、 (6) 练习C5 列车时刻表;(7) 练习C7 鱼口模拟;(8) 练习1.2 账务处理系统;(9) 练习C3 最小费用路径;(10)练习1.1利润计划编制三、实验结果练习C1 利息计算本实验的目的是已经本金和利率求利息,公式为利息=本金*(1+利率)年数需要确定的数是本金,利率和年份 打开VB软件,创建一个利息计算的窗口,在其中拉入7个Label标签框,1个Frame框架,3个TextBox文本框,2个CommandButton命令按钮,调节界面,如下图所示 据题目要求,输入代码,进行程序设计 运行程序,输入本金10000,利率3%,年数为3,检验是否正确,结果如图练习C2 最优加工顺序本实

3、验的目的是某车间有n个待加工零件,只有一台车床和一台铣床可供使用。这些零件都需要先车后铣,为了以最短时间完成加工任务,根据它们在各机床上加工所需工时, 试利用计算机排出最优加工顺序表。 打开VB软件,创建2个最优加工顺序的窗口和一个模块,定义所需加工的数量,窗体1拉入5个Label标签框和2个TextBox文本框,窗体2中拉入1个Label标签框和2个CommandButton命令按钮,按如下格式摆放 根据题目要求输入代码进行程序设计,分别对模块和2个窗体进行设计Option ExplicitDim NN As IntegerPrivate Sub Command1_Click() Dim i

4、 As Integer For i = 1 To NN If Text1(i).Text = Or Text2(i) = Or IsZs1(Text1(i) = False Or IsZs1(Text2(i) = False Then MsgBox 信息不全或非正数 Exit Sub End If Next i Dim PX() As Integer ReDim PX(NN + 1) Dim KT As Integer Dim JW As Integer For i = 0 To NN PX(i) = 0 Next i KT = 1 JW = NN Dim MIN As Long Dim MI

5、N_index As Integer gong jian hao MIN = MIN_index = 1 Dim MIN_sx As Integer na yi hang MIN_sx = 1 While KT JW MIN = For i = 1 To NN If isPaichu(i, PX) = False Then If CInt(Text1(i).Text) MIN Then MIN = CInt(Text1(i).Text) MIN_index = i MIN_sx = 1 End If If CInt(Text2(i).Text) MIN Then MIN = CInt(Text

6、2(i).Text) MIN_index = i MIN_sx = 2 End If End If Next i If MIN_sx = 1 Then PX(KT) = MIN_index KT = KT + 1 End If If MIN_sx = 2 Then PX(JW) = MIN_index JW = JW - 1 End If Wend For i = 1 To NN If isPaichu(i, PX) = False Then Exit For Next i PX(KT) = i Dim str As String str = 工件加工顺序是: For i = 1 To NN

7、str = str & & PX(i) Next i Label3.Caption = strEnd SubPrivate Sub Command2_Click() Unload Me End SubPrivate Sub Form_Load() Dim rrr As String rrr = InputBox(请输入待加工的零件数!) If rrr = Then Exit Sub NN = CInt(rrr) Dim Text1() As TextBox Dim Text2() As TextBox Dim i As Integer ReDim Text1(NN + 1) ReDim Tex

8、t2(NN + 1) For i = 1 To NN Load Text1(i) Text1(i).Visible = True Text1(i).Text = Text1(i).Move Text1(i - 1).Left + Text1(i - 1).Width, Text1(i - 1).Top, Text1(i).Width, Text1(i).Height Load Text2(i) Text2(i).Visible = True Text2(i).Text = Text2(i).Move Text2(i - 1).Left + Text2(i - 1).Width, Text2(i

9、 - 1).Top, Text2(i).Width, Text2(i).Height Load Lab(i) Lab(i).Visible = True Lab(i).Caption = & i Lab(i).Move Text2(i).Left, Lab(i - 1).Top, Lab(i).Width, Lab(i).Height Next i End SubPrivate Sub Command1_Click() Form1.Show Unload Me End SubPrivate Sub Command2_Click() Unload Me End SubPrivate Sub Fo

10、rm_Load()Label1.Caption = 某车间有n个待加工零件,只有一台车床和一台铣床可供使用。这些零件都需要先车后铣,为了以最短时间完成加工任务,根据它们在各机床上加工所需工时试利用计算机排出最优加工顺序表。End Sub 运行软件,分别输入2次,单位时间分别为10,11,12,13,运行的结果为顺序先后为1,2 练习C4 生成最小生成树本实验的是在八个城市之间建造电视微波中继站,可行线路旁的弧旁数字为费用,求建在哪个城市可实现连通每个城市且费用为最低。 打开VB软件,创建一个生成最小生成树的窗体,拉出2个Label标签框,3个CommandButton命令按钮,1个Pictur

11、eBox图片框,如图所示 根据题目要求,输入代码,具体如下:Option ExplicitPrivate Type LJ i As Integer j As Integer w As Integer flag As Boolean End TypePrivate Type code self As Integer father As IntegerEnd TypeDim xx(16) As LJ 边Dim cod(9) As code 根节点Private Sub PL(i As Integer, j As Integer) Dim xx1, xx2, yy1, yy2 As Integer

12、xx1 = City(i).Left + 0.5 * City(i).Width yy1 = City(i).Top + 0.5 * City(i).Height xx2 = City(j).Left + 0.5 * City(j).Width yy2 = City(j).Top + 0.5 * City(j).Height Pp.Line (xx1, yy1)-(xx2, yy2), RGB(0, 0, 255) End SubPrivate Sub PL2(i As Integer, j As Integer) Dim xx1, xx2, yy1, yy2 As Integer xx1 =

13、 City(i).Left + 0.5 * City(i).Width yy1 = City(i).Top + 0.5 * City(i).Height xx2 = City(j).Left + 0.5 * City(j).Width yy2 = City(j).Top + 0.5 * City(j).Height Pp.Line (xx1, yy1)-(xx2, yy2), RGB(255, 0, 0) End SubPrivate Sub Command1_Click() Dim total As Integer Dim num As Integer total = 0 总费用 num =

14、 0 记录最小生成树的边数 Dim i As Integer For i = 0 To 8 cod(i).self = i cod(i).father = 0 Next Dim min As Integer Dim x As Integer Dim y As Integer While num 7ooo: min = Minum() x = xx(min).i y = xx(min).j If SBoot(x) = SBoot(y) Then xx(min).flag = True MsgBox min & error GoTo ooo Else cod(SBoot(y).father = S

15、Boot(x) total = total + xx(min).w Call PL2(x, y) num = num + 1 xx(min).flag = True beep: beep: beep MsgBox x & , & y & , & total End If Wend label.Caption = 总费用为 & totalEnd SubPrivate Sub Command2_Click() label.Caption = Call PL(1, 2) Call PL(1, 4) Call PL(1, 6) Call PL(2, 4) Call PL(4, 6) Call PL(2

16、, 3) Call PL(2, 5) Call PL(4, 5) Call PL(4, 7) Call PL(6, 7) Call PL(7, 8) Call PL(5, 7) Call PL(5, 8) Call PL(3, 5) Call PL(3, 8) With xx(0) .i = 10 .j = 10 .w = 100 End With With xx(1) .i = 1 .j = 2 .w = 6 End With With xx(2) .i = 1 .j = 4 .w = 4 End With With xx(3) .i = 1 .j = 6 .w = 9 End With W

17、ith xx(4) .i = 2 .j = 4 .w = 2 End With With xx(5) .i = 6 .j = 4 .w = 6 End With With xx(6) .i = 6 .j = 7 .w = 4 End With With xx(7) .i = 4 .j = 7 .w = 7 End With With xx(8) .i = 5 .j = 7 .w = 11 End With With xx(9) .i = 7 .j = 8 .w = 5 End With With xx(10) .i = 2 .j = 5 .w = 13 End With With xx(11)

18、 .i = 5 .j = 8 .w = 3 End With With xx(12) .i = 3 .j = 8 .w = 7 End With With xx(13) .i = 3 .j = 5 .w = 5 End With With xx(14) .i = 2 .j = 3 .w = 10 End With With xx(15) .i = 4 .j = 5 .w = 7 End With Dim ii As Integer For ii = 0 To 15 xx(ii).flag = False Next ii Command1.Enabled = TrueEnd SubPrivate

19、 Function SBoot(x As Integer) As Integer Dim temp As Integer Dim pa As Integer pa = x temp = cod(x).father While temp 0 pa = temp temp = cod(pa).father Wend SBoot = paEnd FunctionPrivate Function Minum() As Integer Dim min As Integer Dim i As Integer min = 1 While xx(min).flag = True And min = 14 mi

20、n = min + 1 Wend For i = min To 15 If xx(i).flag = False Then If xx(i).w xx(min).w Then min = i End If Next Minum = minEnd FunctionPrivate Sub Command3_Click() Unload MeEnd SubPrivate Sub Form_Load() Label16.Caption = 在八个城市之间建造电视微波中继站,如图是可行线路,弧旁数字为费用。试建在哪个城市可实现连通每个城市且费用为最低 Command1.Enabled = FalseEn

21、d Sub 运行程序,观察最省方案练习C5 列车时刻表本实验是在城市A与城市B之间有列车往返行驶。列车每隔30min由A向B驶出。行驶时间T的长短是变化的,这取决于中间停车次数和时间,其取之范围为:30minT56min。列车到达A(或B)站后,停车5min才能开出。从A城市开出一辆车,如果能在B城市开出的一辆车发车前5min到达B城市,可以省去B城市发一辆车。同样地,从B城市开出的一辆车,如果在A城市开出的一辆车发车前5min到达A城市,可以省去A城市发一辆车,编写一个程序计算需要多少列车在A与B之间往返行驶。 打开VB软件,创建一个列车时刻表的窗体,包含2个文件,一个拉出1个Label和2

22、个CommandButton命令按钮,另一个拉出一个TextBox文本框,如图 根据题目要求,输入代码Option ExplicitPrivate Sub Command1_Click() Dim D1(3, 50) As Integer Dim D2(3, 50) As Integer Dim I As Integer I = 0 Dim P As Integer For P = 1 To 48 D1(1, P) = I D2(1, P) = I I = I + 30 Next P Dim F As Integer For P = 1 To 48 F = CInt(Rnd() * 100)

23、While (F 56) F = CInt(Rnd() * 100) Wend D1(2, P) = F Next P For P = 1 To 48 F = CInt(Rnd() * 100) While (F 56) F = CInt(Rnd() * 100) Wend D2(2, P) = F Next P - Dim L1 As Integer Dim L2 As Integer Dim P1 As Integer Dim P2 As Integer Dim L As Integer L1 = 48 L2 = 48 P1 = 1 P2 = 1 While P2 = 48 If D1(1

24、, P1) + D2(2, P1) + 5 = D2(1, P2) Then L2 = L2 - 1 P1 = P1 + 1 End If P2 = P2 + 1 Wend P1 = 1 P2 = 1 - While P1 = 48 If D2(1, P2) + D2(2, P2) + 5 = D1(1, P1) Then L1 = L1 - 1 P2 = P2 + 1 End If P1 = P1 + 1 Wend L = L1 + L2-Label1.Caption = 需要的列车总数是: & LDim K, J As IntegerDim T1, T2, T3, T4 As Intege

25、rJ = 0-Form2.ShowForm2.rtb.Text = & flksDim traintime As Stringtraintime = 需要的列车总数是: & L & Chr(13) & 列车时刻表 & Chr(13) & Chr(13)traintime = traintime & 城市的火车时刻表: & Chr(13)traintime = traintime & 开点运行时间开点运行时间 & Chr(13)For K = 1 To 24 T1 = CInt(D1(1, K + J) / 60) T2 = D1(1, K + J) - 60 * T1 T3 = CInt(D1

26、(1, K + J + 1) / 60) T4 = Abs(D1(1, K + J + 1) - 60 * T3) traintime = traintime & T1 & : & T2 & & D1(2, K + J) & & T3 & : & T4 & & D1(2, K + J + 1) & Chr(13) J = J + 1 Next K traintime = traintime & Chr(13) & 城市的火车时刻表: & Chr(13) & 开点运行时间开点运行时间 & Chr(13) J = 0 Dim T5, T6, T7, T8 As Integer For K = 1

27、To 24 T5 = CInt(D2(1, K + J) / 60) T6 = D2(1, K + J) - 60 * T5 T7 = CInt(D2(1, K + J + 1) / 60) T8 = Abs(D2(1, K + J + 1) - 60 * T7) traintime = traintime & T5 & : & T6 & & D2(2, K + J) & & T7 & : & T8 & & D2(2, K + J + 1) & Chr(13) J = J + 1 Next K Form2.rtb.Text = traintime -End SubPrivate Sub Com

28、mand2_Click() Unload MeEnd SubPrivate Sub Form_Load() Label3.Caption = 在城市A与城市B之间有列车往返行驶。列车每隔30min由A向B驶出。行驶时间T的长短是变化的,这取决于中间停车次数和时间,其取之范围为:30minT56min。列车到达A(或B)站后,停车5min才能开出。从A城市开出一辆车,如果能在B城市开出的一辆车发车前5min到达B城市,可以省去B城市发一辆车。同样地,从B城市开出的一辆车,如果在A城市开出的一辆车发车前5min到达A城市,可以省去A城市发一辆车,编写一个程序计算需要多少列车在A与B之间往返行驶?E

29、nd Sub 运行程序,检验是否正确练习C7 鱼口模拟本实验的目的是通过鱼口模拟,清晰地知道经过X年后,鱼塘中鱼,幼鱼,小鱼,成年鱼和老鱼的个数需要确定的对象为年份,根据代码自动生成鱼的总数,以及幼鱼,小鱼,成年鱼和老鱼的个数,根据月份有序的展现出来 打开VB软件,创建一个鱼口模拟的窗口 在界面中拉入2个Label标签框,2个CommandButton命令按钮(命名为cmd开始模拟和cmdExit),1个Line,1个TextBox文本框(命名为txt年数),在标签框中输入文字简介,如上图所示,再一次根据要求改变按钮的具体属性值 程序设计,根据题目要求,设置每一个按钮的程序,输入代码Optio

30、n ExplicitPrivate Sub cmdExit_Click() Unload MeEnd Sub A- 幼鱼数(1-3) B- 小鱼数(4-6) C- 成鱼数(7-18) D - 老鱼数(18 - 24) F- 新增鱼数 M- 总鱼数Private Sub cmd开始模拟_Click()Dim A1 As IntegerDim A2 As IntegerDim A3 As IntegerDim B1 As IntegerDim B2 As IntegerDim B3 As IntegerDim C1 As IntegerDim C2 As IntegerDim C3 As Inte

31、gerDim C4 As IntegerDim C5 As IntegerDim C6 As IntegerDim C7 As IntegerDim C8 As IntegerDim C9 As IntegerDim C10 As IntegerDim C11 As IntegerDim C12 As IntegerDim D1 As IntegerDim D2 As IntegerDim D3 As IntegerDim D4 As IntegerDim D5 As IntegerDim D6 As IntegerDim A As IntegerDim B As IntegerDim C A

32、s IntegerDim D As IntegerDim F As DoubleRem 鱼口模拟 Me.Cls20 Print 输入要打印的年数!N=?Print Print 30 N = Trim(txt年数.Text) If Not IsNumeric(txt年数.Text) Then MsgBox 非数值!请重新选择, , 提示 txt年数.Text = Exit Sub End If If N 4 Then MsgBox 数值太大,会有溢出!请选择1或2, , 提示 txt年数.Text = Exit Sub End If40 A1 = 250 A2 = 0: A3 = 0: B1 =

33、 0: B2 = 0: B3 = 060 C1 = 0: C2 = 0: C3 = 0: C4 = 0: C5 = 0: C6 = 0: C7 = 0: C8 = 0: C9 = 0: C10 = 0: C11 = 0: C12 = 070 D1 = 0: D2 = 0: D3 = 0: D4 = 0: D5 = 0: D6 = 080 i = 1: A = A190 B = C = D = M = 0100 Print 月份, 幼鱼数(1-3), 小鱼数(4-6), 成鱼数(7-18), 老鱼数(19-24), 总鱼数105 If A 1 Then A = 0 If B 1 Then B =

34、 0 If C 1 Then C = 0 If D 1 Then D = 0 If M 1 Then M = 0110 M = A + B + C + D120 Print Tab(8); i; Tab(20); A; Tab(34); B; Tab(50); C; Tab(68); D; Tab(82); M130 D6 = D5: D5 = D4: D4 = D3: D3 = D2: D2 = D1: D1 = C12: C12 = C11: C11 = C10: C10 = C9140 C9 = C8: C8 = C7: C7 = C6: C6 = C5: C5 = C4: C4 = C

35、3: C3 = C2: C2 = C1150 C1 = B3: B3 = B2: B2 = B1: B1 = A3: A3 = A2: A2 = A1160 A = A1 + A2 + A3170 B = B1 + B2 + B3180 C = C1 + C2 + C3 + C4 + C5 + C6 + C7 + C8 + C9 + C10 + C11 + C12190 D = D1 + D2 + D3 + D4 + D5 + D6200 F = Int(C / 2 * 10 - (B + C + D) * 4)210 If F 5 Then A1 = B230 A = A1 + A2 + A

36、3240 i = i + 1250 If N * 12 = i Then GoTo 105260 End Exit Sub End Sub 输入代码完成后,即可运行程序再进行进一步修改,如下图所示,输入年份为“1”时运行软件,可得到如下的结果练习C6统计价格小于1000的产品数据本实验的目的是寻找所有小于1000的数据 打开VB程序,创建一个统计价格小于1000的产品数据的窗口,分成两个部分,具体如下: 分别输入代码,调整各项属性值Option ExplicitPrivate cnn As New ADODB.ConnectionPrivate rs As New ADODB.Recordse

37、tDim str As StringPublic Sub showdata(ByVal MSF As MSHFlexGrid, ByVal sql As String) 对MSHFlexGrid控件录入数据信息 Dim i As Integer init_ado rs.Open sql, cnn, , , adCmdText With MSF .Rows = 10 .Row = 1 Do While Not rs.EOF .Rows = .Rows + 1 For i = 1 To rs.Fields.Count .TextMatrix(.Row, i) = rs.Fields(i - 1)

38、Next i .Row = .Row + 1 rs.MoveNext Loop .Refresh End With rs.CloseEnd SubPrivate Sub init_ado() 初始化cnn和rs Dim strcnn Set cnn = New ADODB.Connection strcnn = Provider=Microsoft.jet.oledb.4.0; & _ Data Source= & App.Path & DB.mdb cnn.Open strcnn Set rs = New ADODB.Recordset rs.CursorType = adOpenKeyset rs.LockType = adLockOptimisticEnd SubPublic Sub showtitle() 初始化MSHFlexGrid1 With MSHFlexGrid1 .Cols = 4 .TextMatrix(0, 1) = 代 码.TextMatrix(0, 2) = 产品名 .TextMatrix(0, 3) = 产 地 .ColWidth(0) = 150

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 教育专区 > 教案示例

本站为文档C TO C交易模式,本站只提供存储空间、用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。本站仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知淘文阁网,我们立即给予删除!客服QQ:136780468 微信:18945177775 电话:18904686070

工信部备案号:黑ICP备15003705号© 2020-2023 www.taowenge.com 淘文阁