,单击此处编辑母版标题样式,单击此处编辑母版文本样式,第二级,第三级,第四级,第五级,2020/2/23,西安邮电大学,#,Lab Programming Syllabus,High-level Language Programming I,Chunhua Pan,Lab Schedule and Policy,Every Wednesday or by appointment;,Totally 24 hours,2 hours per week;,Please be sure to get in the lab on time;,Assignment 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.,2,Programming Environment,3,Assignment#1,Write a program to show the following sentences:,I am a student.,I love China.,4,Assignment#1,Write a program to show the following figure:,5,Assignment#1,Given the values of three variables,a=2,b=4,c=7,write a program to,calculate the sum of a,b and c;,compute and output the value of variable,x,where,x=a/(b c),The result should be like the figure shown below:,6,Assignment#2,Write a program to get the values of integer a and b from the keyboard,and then calculate the results of,a+b,a b,a*b,a/b,and,a%b,respectively.,7,Assignment#2,Input the bottom length and height of a triangle,output the area of this triangle(Reserve two effective digits).,8,Assignment#2,Input five integers from the keyboard,and then output the minimum number among them.,9,Assignment#3,Input n from keyboard,and calculate n!,10,Assignment#3,Print the first 20 Fibonacci Numbers.,11,Assignment#3,Print all the,“Daffodils Number”,between 100 999.,12,Assignment#3,Input several numbers from keyboard,print the max number among them.,13,Assignment#4,Write a function to return the maximum number in five numbers,you can use the function,getMax(int a,int b,int c),two times.,14,Assignment#4,Write a program to accept two numbers from the keyboard,and then print the greatest common divisor(,最大公约数,)and the least common multiple(,最小公倍数,)using functions.,15,Assignment#4,Calculate 1+2+n using,nested,calls of functions.,16,Assignment#4,Calculate 1+2+n using,recursive,calls of functions.,17,Assignment#5,Input several numbers,and output its reverse.,18,Assignment#5,Input a string,output the number of words it contains.,19,Assignment#5,Write a program to accept a string and a character,and then delete each element which is equal to the character from the array.,20,Assignment#5,Write a program to implement the following questions:,Define a function,void input(int s,int n),to get ten integers into an array;,Define a function,void sort(int s,int n),to sort these integers in the array;,Define a function,void print(int s,int n),to output the sorted numbers in the array;,Finally,write appropriate,main,function to test your program.,21,Assignment#6,Use the,arrays of structures,to store five students information including,id,name,and,score,input the information from the keyboard,output the information of the student with the,maximum score,then,sort,these students by scores from low to high,finally,output information of these students.,22,23,Assignment#6,Write a function,void,decrement(,int,*,a)to decrease the value of the argument in the main function by 1.You should use pointer as parameter to the function,decrement,24,Assignment#7,Write a function,void,decrement(,int,*,a)to decrease the value of the argument in the main function by 1.You should use pointer as parameter to the function,decrement.,Similarly,write a function,swap,to exchange the values of two variables outside the function,25,Assignment#7,Input,n,from the keyboard,Input,n,numbers from the keyboard and store them to a,dynamically allocated array,Sort,these numbers using any of the sorting algorithms,Output the sorted numbers to the,screen,Finally,output these sorted numbers to,a file,named“output.txt”,26,Assignment#8,Input,n,from the keyboard,Input,n,students data from the keyboard and store them to a,dynamically allocated array of structures,Output the student that has the,maximum grade,to the screen,Sort,these students data by score from low to high,Finally,output these data to,a file,named“output.txt”,27,Assignment#9,Write 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;,Output 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;,28,Assignment#9,29,Assignment#10,Write a program to implement the address book using dynamic singly linked list,the node should contain,name,address,and,phone#,:,Write a function,create,to store three peoples information into the singly linked list;,Write a function,print,to print these information to the standard output;,Write a function,search,to find the telephone number of a contact input by name.,30,Assignment#10,31,Assignment#11,Define a,dynamic singly linked list,to store staffs information including,id,name,and,salary,.Please note that all the information should be input fro