最新-C语言外语课件-PPT精品.ppt

上传人(卖家):三亚风情 文档编号:3537847 上传时间:2022-09-13 格式:PPT 页数:34 大小:1.44MB
下载 相关 举报
最新-C语言外语课件-PPT精品.ppt_第1页
第1页 / 共34页
最新-C语言外语课件-PPT精品.ppt_第2页
第2页 / 共34页
最新-C语言外语课件-PPT精品.ppt_第3页
第3页 / 共34页
最新-C语言外语课件-PPT精品.ppt_第4页
第4页 / 共34页
最新-C语言外语课件-PPT精品.ppt_第5页
第5页 / 共34页
点击查看更多>>
资源描述

1、 Lab Programming SyllabusLab Programming Syllabus High-level Language Programming I High-level Language Programming I Chunhua PanChunhua PanLab Schedule and PolicyLab Schedule and PolicyEvery Wednesday or by appointment;Totally 24 hours,2 hours per week;Please be sure to get in the lab on time;Assig

2、nment will be shown in the class on the morning of the same day;Some assignments will be graded;It is a good habit to write the program on paper prior the lab time;Please write your program carefully and independently.2Programming EnvironmentProgramming Environment3Assignment#1Assignment#1Write a pr

3、ogram to show the following sentences:I am a student.I love China.4Assignment#1Assignment#1Write a program to show the following figure:5Assignment#1Assignment#1Given the values of three variables a=2,b=4,c=7a=2,b=4,c=7,write a program to calculate the sum of a,b and c;compute and output the value o

4、f variable x x,where x=a/(b c)x=a/(b c)The result should be like the figure shown below:6Assignment#2Assignment#2Write a program to get the values of integer a and b from the keyboard,and then calculate the results of a+ba+b,a ba b,a a*b b,a/b a/b and a%ba%b respectively.7Assignment#2Assignment#2Inp

5、ut the bottom length and height of a triangle,output the area of this triangle(Reserve two effective digits).8Assignment#2Assignment#2Input five integers from the keyboard,and then output the minimum number among them.9Assignment#3Assignment#3Input n from keyboard,and calculate n!10Assignment#3Assig

6、nment#3Print the first 20 Fibonacci Numbers.11Assignment#3Assignment#3Print all the“Daffodils Number”“Daffodils Number”between 100 999.12Assignment#3Assignment#3Input several numbers from keyboard,print the max number among them.13Assignment#4Assignment#4Write a function to return the maximum number

7、 in five numbers,you can use the function getMax(int a,int b,int c)getMax(int a,int b,int c)two times.14Assignment#4Assignment#4Write a program to accept two numbers from the keyboard,and then print the greatest common divisor(最大公约数)and the least common multiple(最小公倍数)using functions.15Assignment#4A

8、ssignment#4Calculate 1+2+n using nestednested calls of functions.16Assignment#4Assignment#4Calculate 1+2+n using recursiverecursive calls of functions.17Assignment#5Assignment#5Input several numbers,and output its reverse.18Assignment#5Assignment#5Input a string,output the number of words it contain

9、s.19Assignment#5Assignment#5Write a program to accept a string and a character,and then delete each element which is equal to the character from the array.20Assignment#5Assignment#5Write a program to implement the following questions:Define a function void void input(intinput(int s,s,intint n)n)to g

10、et ten integers into an array;Define a function void void sort(intsort(int s,s,intint n)n)to sort these integers in the array;Define a function void void print(intprint(int s,s,intint n)n)to output the sorted numbers in the array;Finally,write appropriate mainmain function to test your program.21Ass

11、ignment#6Assignment#6Use the arrays of structures arrays of structures to store five students information including id id,namename and scorescore,input the information from the keyboard,output the information of the student with the maximum scoremaximum score,then sort sort these students by scores

12、from low to high,finally,output information of these students.2223Assignment#6Assignment#6Write a function voidvoid decrement(intint*a)to decrease the value of the argument in the main function by 1.You should use pointer as parameter to the function decrementdecrement24Assignment#7Assignment#7Write

13、 a function voidvoid decrement(intint*a)to decrease the value of the argument in the main function by 1.You should use pointer as parameter to the function decrement.decrement.Similarly,write a function swapswap to exchange the values of two variables outside the function25Assignment#7Assignment#7In

14、put n n from the keyboardInput n n numbers from the keyboard and store them to a dynamically allocated arraydynamically allocated arraySortSort these numbers using any of the sorting algorithmsOutput the sorted numbers to the screenscreenFinally,output these sorted numbers to a file a file named“out

15、put.txt”26Assignment#8Assignment#8Input n n from the keyboardInput n n students data from the keyboard and store them to a dynamically allocated array of structuresdynamically allocated array of structuresOutput the student that has the maximum grade maximum grade to the screenSort Sort these studen

16、ts data by score from low to highFinally,output these data to a file a file named“output.txt”27Assignment#9Assignment#9Write a program to implement the following questions.Input the size for the first array;Input the size for the second array;Input the numbers for the first and the second array;Outp

17、ut he numbers which the first array has but the second array does not have;Output the numbers which the second array has but the first array does not have;Output the common elements of the two arrays;28Assignment#9Assignment#929Assignment#10Assignment#10Write a program to implement the address book

18、using dynamic singly linked list,the node should contain namename,addressaddress and phone#phone#:Write a function createcreate to store three peoples information into the singly linked list;Write a function printprint to print these information to the standard output;Write a function searchsearch t

19、o find the telephone number of a contact input by name.30Assignment#10Assignment#1031Assignment#11Assignment#11Define a dynamic singly linked list dynamic singly linked list to store staffs information including id id,namename and salarysalary.Please note that all the information should be input fro

20、m the keyboard.Implement a function creat()creat()to return the head pointer of the linked list;Implement a function named insert()insert()to insert a staff into the linked list with the id id from low to high;Implement a function named delete()delete()to delete a staff with id n from the linked lis

21、t;Implement a function named print()print()to print all the staff in the linked list to the standard output screen;Implement a function named printToFile()printToFile()to print all the staff in the linked list to a file.32Assignment#12Assignment#12Define a book search card structure including book_n

22、amebook_name,authorauthor,publish_datepublish_date,register_numregister_num and priceprice.Input all the member variables of the structure and then output.Use the arrays of structures to store five students information including id id,namename and scorescore,input the information from the keyboard,then output the averageaverage score of the students.33Next AssignmentNext AssignmentNoneThank you!Thank you!34

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 办公、行业 > 各类PPT课件(模板)
版权提示 | 免责声明

1,本文(最新-C语言外语课件-PPT精品.ppt)为本站会员(三亚风情)主动上传,163文库仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。
2,用户下载本文档,所消耗的文币(积分)将全额增加到上传者的账号。
3, 若此文所含内容侵犯了您的版权或隐私,请立即通知163文库(发送邮件至3464097650@qq.com或直接QQ联系客服),我们立即给予删除!


侵权处理QQ:3464097650--上传资料QQ:3464097650

【声明】本站为“文档C2C交易模式”,即用户上传的文档直接卖给(下载)用户,本站只是网络空间服务平台,本站所有原创文档下载所得归上传人所有,如您发现上传作品侵犯了您的版权,请立刻联系我们并提供证据,我们将在3个工作日内予以改正。


163文库-Www.163Wenku.Com |网站地图|