Final 109j2

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

C Programming CP119_ J2 (afternoon class) final

 禁用隨身碟, 計算機, 手機, 電子字典, 小抄等,禁止交談、看別人電腦、打開電腦預存檔案


等一經發現就是作弊。作弊該科零分直接當掉,另報請系主任處理。
 Students who violate the exam rules will get a ZERO score in this course.
 一律使用 visual studio 寫程式,不用壓縮,直接上傳 cpp 檔
 Use Visual Studio to write your program, upload the cpp file.
 Project 命名: s+學號, ex. s1061234, 不是你的學號,一律 0 分
 Your project name should be s+student_ID, ex. s1061234
 If the student_ID is not yours, you will get a zero score.
 在程式碼前面註解輸入學號姓名, Write your student ID and name at the top of the code.
 題目要求以英文為主, 中文只供參考, example 僅供解釋題目,程式需滿足其他輸入
 Problem:
 讀取“2008R_j2.txt”. 定義結構儲存資料, 包含三欄位 date: char[10], TICKER: char[6],
and RET: double. In main(), (1) 先讀取一次,判斷資料筆數. (2) 使用 new 動態配置記
憶體給結構陣列 (3) 讀取資料儲存在結構陣列. (4) 寫一個 function,把結構陣列傳給
function, 計算每個月的平均 RET 值,並儲存到 “output.txt”. output.txt 要包含兩個
欄位: Month and AVG_RET (顯示到小數點後面 8 位). (5) 程式最後 delete 結構陣列. (6)
一筆資料若不完整, 就直接跳過該筆資料, 不列入平均計算

Output file
Month AVG_RET
2008/01 0.00003605
2008/02 …

 沒寫 function 扣 50
 評分標準, 10% 做為註解說明, 註解詳盡, 才可拿這 10 分
 為避免有作弊抄襲情況發生, 若助教發現 N 人答案過於相似雷同, 這些人的分數都會
除/N

You might also like