




已阅读5页,还剩32页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
计算机应用实践报告计算机应用实践报告 机房名称机房名称 时时 间间 至至 学学 院院 专业班级专业班级 姓姓 名名 学学 号号 指导教师指导教师 成成 绩绩 年年 月月 说说 明明 一 计算机应用实践是本科教学重要的实践教学环节 是提高学生应用计算机 能力的重要措施 所有参加计算机应用实践教学活动的学生都必须撰写实 践报告 二 计算机应用实践报告的质量反映了计算机应用实践的教学质量 它是评定 计算机应用实践成绩的主要依据之一 不交实践报告者不得参加实习成绩 评定 三 指导教师必须对学生的实践报告写出评语并在相应位置给出成绩并签字 否则本实践报告无效 四 实践报告要求条理清晰 内容详尽 数据准确 字数不少于 5000 字 五 计算机应用实践活动结束后请将本报告上交学院存档保存 1 计算机应用实践报告计算机应用实践报告 暑假很快就过完了 但大一还没结束 因为还没有正式开学 就这样 计算机实践成了大一的最后 一门课 带着一种好奇与特殊的心情开始了第一天计算机实践 由于有 C 的经验 就在心里告诉 自己 没事的 万事开头难 只要我好好学习 开一个好头 我的 C 成绩也会像 C 一样优秀的 第一天当课本下发到手中时 许多人唏嘘 我想现在正是我超越别人的时刻 我没有被厚重的书本 吓倒 制定好了自己的计划 要求自己提前完成课程 这正是我事事争先的性格 我抱着这种积极 的心态去迎接每一天的挑战 在心理上就战胜了困难 做起题来 如鱼得水 显得比别的同学轻松 得多 差距就是这样一天天拉开的 而不是一点点拉开 有的同学放纵自己一次 就有了堕落的开 始 就这样 轻松地很快被人落在后面 上机时 我也遇到过几次头疼的题目 可是我深知这些道 理 所以就告诉自己坚持下去 不要放弃 所以也就莫名其妙地熬过了这些难题 总之 一次简单 的计算机实践 短短的几天学习 让我更深刻的了解到自己懂得的先辈也一直在说的道理 一个就 是万事开头难 另一个是生活是靠一点一滴的争取获得的 这两句话的密钥就是坚持 经过十天对 Visual C NET 程序设计的学习 在掌握了部分 C 语言的基础下 我对程序编辑与设计 又有了新的认识 首先 Visual C NET 是建立在 C 语言上的程序编辑与设计技术 它既具有 C 语言功能的强大和 灵活 又让学者能简单入门 C 的程序语言与 C 有很大的相似之处 但其作为设计领域更广的语 言 设计领域涉及文字图像处理 数据库 多媒体 网络 它在开发环境与运算规则方面与 C 又 大为不同 以下各习题就是 C 在程序设计上的多种用途 习题 1 计算 1949 到 2003 年有多少个闰年 设计思路 构建函数 运用 for 循环搭配 if 语句判定 1949 到 2003 年能整除 4 的年份并计数 代码 using System using System Collections Generic using System Linq using System Text namespace ConsoleApplication2 class Program static void Main string args int i mount 0 for i 1949 i 2003 i if i 4 0 mount Console WriteLine 从1949年到2003年闰年数 0 mount 2 习题 2 编写程序输出以下列表 1 10 100 1000 2 20 200 2000 3 30 300 3000 设计思路 构建函数 由于每行后一个数事前一个数的十倍 运用 for 循环嵌套使每列递增 每行按 10 倍递增 排列 代码 using System using System Collections Generic using System Linq using System Text namespace ConsoleApplication3 class Program static void Main string args int i j for i 1 i 3 i for j i j 3 j Console WriteLine 0 1 2 3 i j 10 j 10 j 10 3 习题 3 使用 while 循环输出 1 36 之间的整数 且每行 6 个整数 设计思路 构建函数 用 while 循环条件设定为整形变量 i 的值小于等于 36 并用输出Console WriteLine 使从 1 开始的递增数列按每行 6 个的方式排列 代码 using System using System Collections Generic using System Linq using System Text namespace ConsoleApplication2 class Program static void Main string args int i 1 while i 282 this timer1 Enabled false this timer2 Enabled true x1 252 if y1 500 7 y1 98 this label1 Location newxy private int x2 282 y2 98 private void timer2 Tick object sender EventArgs e x2 30 y2 0 Point newxy new Point x2 y2 if x2 85 分 为 A 等 d 70 分 为 B 等 否则为 C 等 设计思路 新建窗口 Form1 添加窗口 Form2 按题目为 Form1 添加控件 并给 Form2 添加显示结果所用控件 为 Form1 中 button1 提交 设计事件 启动 Form2 并将 Form1 中文本框内内容传递到 Form2 中对 应文本框 按分数计算公式得出该生成绩 用 if 语句判定成绩的等级 代码 using System using System Collections Generic using System ComponentModel using System Data using System Drawing using System Linq using System Text using System Windows Forms namespace WindowsFormsApplication3 public partial class Form1 Form 15 public Form1 InitializeComponent private void button1 Click object sender EventArgs e Form2 ff new Form2 ff Controls textbox1 Text this textBox1 Text ff Controls textbox2 Text this textBox2 Text ff Controls textbox3 Text this textBox3 Text ff Controls textbox4 Text this textBox4 Text ff Controls textbox5 Text this textBox5 Text ff Show double num1 Convert ToDouble textBox3 Text double num2 Convert ToDouble textBox4 Text double num3 Convert ToDouble textBox5 Text double m num1 0 3 num2 0 3 num3 0 4 if m 70 0 16 补充题 4 建立一个 Name 为 Frm String 的窗体 字体为 宋体 9 号 固定边界 在窗体中添加一个文本框 可以多行输入与显示 在窗体中添加一个命令按钮 从磁盘中读取文本文件在文本框中显示 编写两个函数分别将文本框中的每个单词的首字母改为大写和小写 在 变换后字符串 文本框中 显示 在窗体中添加一个列表框 编写一个函数将文本框中的字符串分解为单词 以空格和回车符为分界 按顺序加入到列表框中 编写两个简易加密和解密函数分别将文本框中的单词加密和解密后在 变换后字符串 文本框中显 17 示 设计代码 using System using System Collections Generic using System ComponentModel using System Data using System Drawing using System Linq using System Text using System Windows Forms namespace WindowsFormsApplication25 public partial class Frm String1 Form public Frm String1 InitializeComponent private void button1 Click object sender EventArgs e string str OpenFileDialog ofd new OpenFileDialog ofd Filter Text File txt txt All File ofd ShowDialog str ofd FileName richTextBox1 LoadFile str RichTextBoxStreamType PlainText private void button2 Click object sender EventArgs e String str richTextBox1 Text Split for int i 0 i str Length i str i str i Substring 0 1 ToUpper str i Substring 1 ToLower String S for int i 0 i str Length i S str i S S Substring 0 S Length 1 richTextBox2 Text S 18 private void button3 Click object sender EventArgs e String str richTextBox1 Text Split for int i 0 i str Length i str i str i Substring 0 1 ToLower str i Substring 1 ToLower String S for int i 0 i str Length i S str i S S Substring 0 S Length 1 richTextBox2 Text S private void button4 Click object sender EventArgs e listBox1 Items Clear String stri richTextBox1 Text Split for int i 0 i stri Length i stri i stri i Substring 0 listBox1 Items Add stri i private void button5 Click object sender EventArgs e String tmstr int i 0 j 0 Char ch tmstr richTextBox1 Text j Convert ToInt32 tmstr i j j 5 128 ch Char j tmstr ch ToString tmstr Substring i 1 for i 1 i tmstr Length i if tmstr i z j 0 19 j Convert ToInt32 tmstr i j j 5 128 ch Char j tmstr tmstr Substring 0 i ch ToString tmstr Substring i 1 richTextBox3 Text tmstr private void button6 Click object sender EventArgs e String tmstr int i 0 j 0 Char ch tmstr richTextBox3 Text j Convert ToInt32 tmstr i j j 123 128 ch Char j tmstr ch ToString tmstr Substring i 1 for i 1 i tmstr Length i j Convert ToInt32 tmstr i j j 123 128 ch Char j tmstr tmstr Substring 0 i ch ToString tmstr Substring i 1 richTextBox4 Text tmstr 20 using System using System Collections Generic using System ComponentModel using System Data using System Drawing using System Text using System Windows Forms namespace Picture public partial class Form1 Form public Form1 InitializeComponent private void button1 Click object sender EventArgs e Application Exit private void Form1 Load object sender EventArgs e 21 using System using System Collections Generic using System Text namespace WelcomeConsole class Program static void Main string args Console WriteLine 欢迎进入C 多彩世界 Console Read using System using System Collections Generic using System Windows Forms namespace S06 static class Program 应用程序的主入口点 STAThread static void Main Application EnableVisualStyles Application SetCompatibleTextRenderingDefault false Application Run new Form1 using System using System Collections Generic using System Text 22 namespace 01 struct Rectangle public int x y 矩形左上角的坐标 public int width height 矩形的宽和高 public Rectangle int a int b int w int h x a y b width w height h class Program static void Main string args 声明一个Rectangle对象 Rectangle myRect 初始化对象 myRect x 20 myRect y 30 myRect width 200 myRect height 300 输出对象的值 Console WriteLine My Rectangle Console WriteLine x 0 y 1 width 2 height 3 myRect x myRect y myRect width myRect height Console Read using System using System Collections Generic using System Text namespace 02 class Program 23 enum Range long Max 2147483648L Min 255L static void Main string args long a long Range Max long b long Range Min Console WriteLine Max 0 Min 1 a b Console Read using System using System Collections Generic using System Windows Forms namespace S06 static class Program 应用程序的主入口点 STAThread static void Main Application EnableVisualStyles Application SetCompatibleTextRenderingDefault false Application Run new Form1 using System using System Collections Generic using System Text namespace 03 class Program static void Main string args string course C Data Structure Software engineering Disp course Console Read 24 static void Disp string arr for int i 0 i arr Length i arr length获取数组的大小 是System Array的公共属性 Console WriteLine course 0 1 i arr i using System using System Collections Generic using System Text namespace 04 class Program static void Main string args int jagArray new int 2 jagArray 0 new int 5 jagArray 1 new int 3 for int i 0 i jagArray GetLength 0 i for int j 0 j jagArray i Length j jagArray i j i j for int k 0 k 2 k Console WriteLine jagArray 0 k for int m 0 m jagArray k Length m Console Write 0 3 jagArray k m Console WriteLine Console Read using System using System Collections Generic using System Windows Forms 25 namespace S06 static class Program 应用程序的主入口点 STAThread static void Main Application EnableVisualStyles Application SetCompatibleTextRenderingDefault false Application Run new Form1 using System using System Collections Generic using System Text namespace 05 class TestVarition public static long x 10 public int y public decimal z int arr new int 2 void Local int a 1 b class Program static void Main string args TestVarition var new TestVarition var z 100 34m Console WriteLine 0 TestVarition x Console Read 26 using System using System Collections Generic using System Text namespace 06 class TestOne static void Main string args int x 65 Console WriteLine operator 0 operator 1 x x 一元加和减 Console WriteLine operator 0 x 0 逻辑非 Console WriteLine operator 0 x 0 x8 x 按位求补 Console WriteLine operator 0 char x 强制转换 Console WriteLine operator 0 operator 1 x x 增量和减量 Console Read using System using System Collections Generic using System Text namespace 07 class TestOperator enum Range long Max 2147483648L Min 255 static void Main string args string str1 String string str2 Add long x 65 枚举的加减法运算 Console WriteLine 0 1 Range Max x Range Min x 运算符用于计算x除3的余数 Console WriteLine A B 0 x 3 用 运算符实现两个字符串的连接 27 Console WriteLine 0 str1 str2 Console Read using System using System Collections Generic using System Windows Forms namespace S06 static class Program 应用程序的主入口点 STAThread static void Main Application EnableVisualStyles Application SetCompatibleTextRenderingDefault false Application Run new Form1 using System using System Collections Generic using System Text namespace 08 class TestOperator static void Main string args int x 3 Console WriteLine 0 1 2 3 4 5 x Console Read 28 using System using System Collections Generic using System Text namespace 09 class TestOperator enum Range long Max 2147483648L Min 255 static void Main string args bool x false y true Console WriteLine 0 x y Range a Range Max b Range Min Console WriteLine 0 a b string m TestEqual string n string Copy m Console WriteLine m n Console WriteLine object m object n Console Read using System using System Collections Generic using System Text namespace 07 class TestOperator enum Range long Max 2147483648L Min 255 static void Main string args string str1 String string str2 Add long x 65 枚举的加减法运算 Console WriteLine 0 1 Range Max x Range Min x 运算符用于计算x除3的余数 Console WriteLine A B 0 x 3 用 运算符实现两个字符串的连接 Console WriteLine 0 str1 str2 Console Read 29 using System using System Collections Generic using System Text namespace 10 class TestOperator static void Main string args string a yes IsString a int b 0 IsString b Console Read static void IsString object s if s is string Console WriteLine It is a string else Console WriteLine It is not a string using System using System Collections Generic using System Text namespace 11 class TestOperator static void Main string args object a yes b 5 string s a as string a转换为字符串 IsString s 30 string t b as string b没有转换为字符串 IsString t Console Read static void IsString object a if a null Console WriteLine It is a string of 0 a else Console WriteLine It is not a string using System using System Collections Generic using System Text namespace 07 class TestOperator enum Range long Max 2147483648L Min 255 static void Main string args string str1 String string str2 Add long x 65 枚举的加减法运算 Console WriteLine 0 1 Range Max x Range Min x 运算符用于计算x除3的余数 Console WriteLine A B 0 x 3 用 运算符实现两个字符串的连接 Console WriteLine 0 str1 str2 Console Read using System using System Collections Generic using System Text namespace 12 31 class GetTypeTest static void Main string args int radius 3 利用typeof获得系统提供的类型 Console WriteLine 0 1 typeof int typeof System Int32 Console WriteLine Area 0 radius radius Math PI 利用GetType获得表
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 自动灭火机器人项目可行性研究报告
- 企业网店经营章程的标准要素
- 环保公益项目实施方案
- 软件及安装服务合同3篇
- 笔石生长速率-洞察及研究
- 2025中国银行流动资金外汇借贷合同2篇
- 溶石药物不良反应监测-洞察及研究
- 四川省德阳市第五中学2025-2026学年高二上学期开学考试数学试卷
- 超参数自适应-洞察及研究
- 部队培训特勤安全处置课件
- 生产提成管理办法
- 2025年宁波市黄湖监狱招聘警务辅助人员考试笔试试题(含答案)
- 教育测量与评价 课件全套 朱德全 第1-15章 教育测量与评价概述- 教育测评结果的统计处理
- 加快健康中国建设课件
- 买卖矿山居间合同协议
- 厌氧氨氧化工艺优化-洞察及研究
- 河北省单招7类数学试卷
- 医院《自媒体管理办法》
- (零诊)成都市2023级(2026届)高中毕业班摸底测试英语试卷(含答案)
- 维护国家安全小学生课件
- 医疗健康新媒体运营方案
评论
0/150
提交评论