




版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
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. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 辦公樓裝飾裝修施工監(jiān)理管理措施
- 2025至2030中國(guó)自動(dòng)顯微鏡行業(yè)發(fā)展趨勢(shì)分析與未來(lái)投資戰(zhàn)略咨詢(xún)研究報(bào)告
- 2025至2030中國(guó)自動(dòng)地板清潔設(shè)備行業(yè)產(chǎn)業(yè)運(yùn)行態(tài)勢(shì)及投資規(guī)劃深度研究報(bào)告
- 2025至2030中國(guó)脫脂酸奶粉行業(yè)市場(chǎng)占有率及投資前景評(píng)估規(guī)劃報(bào)告
- 口腔健康與保健知識(shí)普及
- 2025至2030中國(guó)聚烯烴行業(yè)發(fā)展研究與產(chǎn)業(yè)戰(zhàn)略規(guī)劃分析評(píng)估報(bào)告
- 2025至2030中國(guó)聯(lián)名卡市場(chǎng)調(diào)研及重點(diǎn)企業(yè)投資評(píng)估規(guī)劃分析報(bào)告
- 2025至2030中國(guó)羽絨被套行業(yè)產(chǎn)業(yè)運(yùn)行態(tài)勢(shì)及投資規(guī)劃深度研究報(bào)告
- 2025至2030中國(guó)美孚潤(rùn)滑油脫蠟(MLDW)技術(shù)行業(yè)產(chǎn)業(yè)運(yùn)行態(tài)勢(shì)及投資規(guī)劃深度研究報(bào)告
- 2025至2030中國(guó)網(wǎng)絡(luò)連接IC卡智能水表行業(yè)市場(chǎng)占有率及投資前景評(píng)估規(guī)劃報(bào)告
- 2025年7月新疆維吾爾自治區(qū)學(xué)業(yè)水平合格性考試歷史試題(含答案)
- 建立并優(yōu)化醫(yī)院的藥品管理體系
- 農(nóng)村農(nóng)資采購(gòu)與供應(yīng)長(zhǎng)期合作協(xié)議
- 反假幣培訓(xùn)課件
- 2025至2030中國(guó)電壓暫降治理行業(yè)產(chǎn)業(yè)運(yùn)行態(tài)勢(shì)及投資規(guī)劃深度研究報(bào)告
- 遼寧省2024年7月普通高中學(xué)業(yè)水平合格性考試化學(xué)試卷(含答案)
- 煤炭造價(jià)知識(shí)培訓(xùn)
- 2025屆遼寧省大連市高新區(qū)英語(yǔ)七年級(jí)第二學(xué)期期末學(xué)業(yè)質(zhì)量監(jiān)測(cè)模擬試題含答案
- 腫瘤全程康復(fù)管理制度
- 對(duì)患者的健康教育制度
- 2025年酒店管理專(zhuān)業(yè)基礎(chǔ)知識(shí)考試試題及答案
評(píng)論
0/150
提交評(píng)論