




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)
文檔簡介
1、Lab Programming Syllabus,High-level Language Programming I,Chunhua Pan,2,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 wil
2、l be graded; It is a good habit to write the program on paper prior the lab time; Please write your program carefully and independently.,3,Programming Environment,4,Assignment #1,Write a program to show the following sentences: I am a student. I love China.,5,Assignment #1,Write a program to show th
3、e following figure:,6,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:,7,Assignment #2,Write a program to get th
4、e 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.,8,Assignment #2,Input the bottom length and height of a triangle, output the area of this triangle (Reserve two effective digits).,9,Assignment #2,Input five integers fro
5、m the keyboard, and then output the minimum number among them.,10,Assignment #3,Input n from keyboard, and calculate n!,11,Assignment #3,Print the first 20 Fibonacci Numbers.,12,Assignment #3,Print all the “Daffodils Number” between 100 999.,13,Assignment #3,Input several numbers from keyboard, prin
6、t the max number among them.,14,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.,15,Assignment #4,Write a program to accept two numbers from the keyboard, and then print the greatest common divisor (最大公約數(shù)) an
7、d the least common multiple (最小公倍數(shù)) using functions.,16,Assignment #4,Calculate 1 + 2 + + n using nested calls of functions.,17,Assignment #4,Calculate 1 + 2 + + n using recursive calls of functions.,18,Assignment #5,Input several numbers, and output its reverse.,19,Assignment #5,Input a string, out
8、put the number of words it contains.,20,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.,21,Assignment #5,Write a program to implement the following questions: Define a function void input(int s, int n) to
9、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.,22,Assignment #6,Use the arrays of struc
10、tures 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.,23,24,Assignment #6,Write
11、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,25,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 po
12、inter as parameter to the function decrement. Similarly, write a function swap to exchange the values of two variables outside the function,26,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
13、 sorting algorithms Output the sorted numbers to the screen Finally, output these sorted numbers to a file named “output.txt”,27,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 t
14、he 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”,28,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
15、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;,29,Assignment #9,30,Assignment #10,Write a program to imp
16、lement 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 fin
17、d the telephone number of a contact input by name.,31,Assignment #10,32,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 from the keyboard. Implement a function creat() to return the hea
18、d pointer of the linked list; Implement a function named insert() to insert a staff into the linked list with the id from low to high; Implement a function named delete() to delete a staff with id n from the linked list; Implement a function named print() to print all the staff in the linked list to the standard output screen; Implement a function named printToFile() to print all the staff in the linked list to a file.,33,Assignment #12,Define a book search card structure including book_name, author, publish_date, register_n
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
- 6. 下載文件中如有侵權(quán)或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 商品房開發(fā)項目精細化成本管控體系研究
- 闊韌帶血腫的健康宣教
- 森林狂犬病健康宣教
- 恥骨良性腫瘤護理措施
- 狼瘡性肺炎的護理查房
- 高校實驗室公共管理視野下的建設(shè)與管理研究
- 2025年四川省眉山市彭山區(qū)一中物理高一下期末達標測試試題含解析
- 餐飲業(yè)市場定位與營銷策略
- 靜脈曲張術(shù)后護理課件
- 開放性肩胛骨骨折查房
- 2025年7月新疆維吾爾自治區(qū)學業(yè)水平合格性考試歷史試題(含答案)
- 建立并優(yōu)化醫(yī)院的藥品管理體系
- 農(nóng)村農(nóng)資采購與供應長期合作協(xié)議
- 反假幣培訓課件
- 2025至2030中國電壓暫降治理行業(yè)產(chǎn)業(yè)運行態(tài)勢及投資規(guī)劃深度研究報告
- 遼寧省2024年7月普通高中學業(yè)水平合格性考試化學試卷(含答案)
- 煤炭造價知識培訓
- 2025屆遼寧省大連市高新區(qū)英語七年級第二學期期末學業(yè)質(zhì)量監(jiān)測模擬試題含答案
- 腫瘤全程康復管理制度
- 危險品運輸學習通超星期末考試答案章節(jié)答案2024年
- (正式版)SHT 3551-2024 石油化工儀表工程施工及驗收規(guī)范
評論
0/150
提交評論