Information Processing Using Python
Instruction:
This coursework contains two individual programming tasks. For each task, you need to produce a
python program and do corresponding tests. One report is required, in which, you need to record
(using screenshots or copy-and-paste) the tests that you have performed for each programming
tasks. A conclusion should be provided for each task, to declare whether, for the particular task, your
implementation satisfies the requirements successfully and effectively. If the tests show the
existence of some problems that you are aware of but unable to fix, you need to include the
problem in your conclusion and state, to your best knowledge, what could be the cause of the
problem.
Submission Instructions:
Submit through learning center. You must include Three files in your submission:
primenumbers.py
csv_to_html.py
report.pdf
The Coursework:
1. [30%] (primenumbers.py) Write a program that asks for an integer as input and finds out all
the primary numbers between 0 and the input number. It displays before exiting the total
number of the prime numbers it has found and the largest prime number.
Here the program is executed for three times with different inputs: 56, 6789 and 54377.
>>>
Please input an integer:56
There are 16 prime numbers between 0 and 56. The max prime is 53
>>>
>>>
Please input an integer:6789
There are 873 prime numbers between 0 and 6789. The max prime is 6781
>>>
>>>
Please input an integer:54377
There are 5532 prime numbers between 0 and 54377. The max prime is 54377
>>>
2. [70%] (csv_to_html.py) A CSV (Comma-separated values) file stores data in plain text. Each
line of the file is a data record, and each record may contain multiple fields. Commas are
used as a separator to separate fields. Here you have a CSV file (download the
test_results.csv from learning center) containing the following lines:
Sample TEST Results
ID,First Name, Last Name, Points
X001,Ben, Jackson, 70
X002,Sara, Doe, 99
X003,Jennifer, Johns, 81
X004,Harry,Li, 76
X005,Mino,Stanbury, 88
X006,Anne, Marrison,69
X007,Sam,Johnson, 56
X008,Jill, Smith, 66
X009, Adam,Cooper, 77
X010,Mary,Alan, 69
Write a program that reads the CSV file, sorts the records and displays the records in an HTML
file. The HTML file you create should:
Display the title.
Display the records in a table with a border.
Display the records in descending order.
Display the average result just below the table.
For HTML information, please go to http://www.w3schools.com/html/.
The following is a sample of the HTML file displayed in a web browser.

+1 862 207 3288 