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