• 沒有找到結果。

Introduction to Computer Programming, 2005

N/A
N/A
Protected

Academic year: 2022

Share "Introduction to Computer Programming, 2005"

Copied!
2
0
0

加載中.... (立即查看全文)

全文

(1)

Introduction to Computer Programming, 2005

Program Assignment Ⅷ

2005/12/12

Scope: Chapter 2 to chapter 11 in Textbook Notice:

1. Plagiarism is prohibited.

2. TA will randomly choose 10 students to demonstrate program.

3. Please make your code readable. Reference for coding style:

http://www.cs.usyd.edu.au/~scilect/tpop/handouts/Style.htm

Problem: In this assignment, you are asked to correct an exam given files of students’ answer and correct answer. Your job is to compute a score for each student given these two files, sort record by name, id, or grade, compute average score and standard deviation, and do some profile such as numbers in a range like 7 students in the range of 70-80. Therefore, you have to output those data into a file. In this assignment, an answer for each problem only has one answer and you have to decide how many points for each problem given numbers of problem in answer file and total points is 100.

Output data format:

John S94001 80 John2 S94002 76

John N S9400n 95 Average Score: 80 Standard deviation: 5 1~10: 1

11~20: 4

91~100: 3 Bonus:

You can try to deal with this assignment when we change that an answer for each problem would be multiple answers. You can write down your idea in a paper or just implement it.

Deadline: 2005/12/26, 12:00 pm Description:

1. Use struct to maintain a student record.

2. You have to set the maximum number of record that you can handle.

3. User can give any file name for students’ answer file, answer file, and output file.

4. If TAs want to sort by name, id, and grade respectively, you will give us three files.

5. In the students’ answer file, we use “\t” as delimiter to separate each field.

Hint:

1. You can use strtok() (string tokens) to get token from string by delimiter.

2. You also can use strsep() (string tokens) to separate strings by delimiter.

(2)

Example Output:

== Data sorting by field ==

Please input the students’ answer file name: std.dat Please input the answer file name: answer.dat Please input the output file name: output.dat Sort by: name(id or grade)

Hand-in:

1. Pack your program (HW8_STUDENTID.c) and document (HW8_STUDENTID.doc (or pdf)) into a compressed file (HW8_STUDENTID.rar (or zip)).

2. In the document, you can explain how to achieve this program and use simple flow chart to show your program architecture. Also, you can show what kind of problems you met on developing this

program and how to solve them. Notice, use one page to document your program. You must use flow chart to illustrate this homework assignment.

3. Send the compressed file to [email protected] with mail subject [cprog2005]HW8_STUDENTID.

4. For example, if your student id is b94902200, the program file name is HW8_b94902200.c, the document file name is HW8_b94902200.doc and compressed file name is HW8_b94902200.rar.

Reference:

The standard deviation of a probability distribution is defined as the square root of the variance ,

where is the mean, is the second raw moment, and denotes an expectation value.

The variance is therefore equal to the second central moment (i.e., moment about the mean),

The square root of the sample variance of a set of values is the sample standard deviation

The above paragraph is excerpted form http://mathworld.wolfram.com/StandardDeviation.html.

參考文獻

相關文件

Because of these conceptual problems, some programming languages either define explicitly no subtype relationship between such generic class instantiations as is the case in C ++

• The burst profile to use for any uplink transmission is defined by the Uplink Interval Usage Code (UIUC).. – Each UIUC is mapped to a burst profile in the

In order to test your program, user can give the value of n to list Padovan sequence from P(0) to P(n) and corresponding accumulated triangle area.. The area of equilateral

Using struct to maintain word database that consists word, word count, and occurrence (line number and the order in the line) called word database.. Using fixed array to store

If both a compute-bound process and an I/O-bound process are waiting for a time slice, which should be given

Suppose you get S points and your i-th opponent gets s i points, then your score is given by std::pair(S, ∑. s

Name: Student ID

MR CLEAN: A Randomized Trial of Intra-arterial Treatment for Acute Ischemic Stroke. • Multicenter Randomized Clinical trial of Endovascular treatment for Acute ischemic stroke in