Introduction
COSC1519 Introduction to Programming Semester 2 2016 – Assignment 1
This is a group assignment and worth 15% of your final grade. The grading is based on both demonstration and final code submission.
Each group may consist of up to two students. You are recommended to form the assignment group with your study buddy. The requirements of the assignment will not change should you choose to work individually.
You must demonstrate your assignment in your timetabled practical class prior to your final submission. Academic Integrity [more]
The submitted assignment must be your own work. No marks will be awarded for any parts that are not created by the members of your group.
Plagiarism is treated very seriously. Plagiarism includes copying code directly from other student groups, the Internet or other resources without proper reference. Sometimes, many students work on the assignment together and submit similar files which may be regarded as plagiarism. Please note that you should always create your own assignment even if you have very similar ideas.
Plagiarism detection tools will be used for all submissions. Penalties will be applied in cases of plagiarism.
General Requirements
Refer to PEP 8 – Style Guide for Python Code for appropriate coding style.
Your final code submission should be clean, neat, and well-formatted (e.g., consistent indentations).
Identifiers should be named properly.
You must include adequate meaningful code-level comments in your program.
Your program must be compatible with Jython Environment for Students (JES) v4.3.
Your program should not hard-code any numeric values expect for those given in the task specification, e.g., do not use manually measured coordinates.
Your program should not hard-code any absolute file paths, e.g.,”H:\\myFolder\\RMIT_Logo.png”.
Your program must adhere to the given basic program flow.
The use of JES built-in functions copyInto, addLine and addRect is prohibited in this assignment as it defeats the assessment purpose.
The names of the input and output picture files must be exactly the same as specified.
1
Your program should be run only via “>>> ipa1()”.
Note: Marks will be deducted if you fail to meet any of the above general requirements.
Task Specification
In preparation for the RMIT Open Day, the University is about to print some colour and grayscale City Campus maps for prospective students. You are responsible for this mission. In the final check-up of the map file before printing, you notice that the RMIT logo is missing.
You task is to ensure that the RMIT logo correctly displays on the bottom right corner of the City Campus map. For better visual quality, you should also draw a thin border of 1-pixel width around the logo and make the logo leave a 4-pixel margin to the border of the map. A computer has been made available for you to deal with the task. The computer has no Internet connection and does not have photo editing software installed. Fortunately, Jython Environment for Students (JES) 4.3 is available on the computer.
Resources
You have been given two colour picture files:
City Campus Map: RMIT_Map.png
RMIT Logo: RMIT_Logo.png
Expected Outputs
You need to produce two picture files:
Modified City Campus Map (Colour): RMIT_Map_Colour.png
Modified City Campus Map (Grayscale): RMIT_Map_Grayscale.png
2
Basic Program Flow
Your program MUST adhere to the following program flow:
1. Prompt the user to pick the original map picture file
2. Make a Picture object for the map picture file
3. Prompt the user to pick the logo picture file
4. Make a Picture object for the logo picture file
5. Draw a thin black border of 1-pixel width around the logo
6. Copy the logo to the bottom right corner of the map while making the logo leave a margin of 4 pixels to the border of the map
a) You should use a nested loop to iterate through the width and the height of the logo
b) You need to translate the coordinates in the logo to the corresponding ones in the map by taking into account the margin
7. Save the modified map as RMIT_Map_Color.png into a selected folder
8. Convert the above colour map to grayscale and save it as RMIT_Map_Grayscale.png into the same
folder as selected above
Demonstration (Week 6 and Week 7)
The whole assignment group must demonstrate the assignment in your timetabled practical class (tutelab) prior to your final submission. Each group member must be able to clearly explain the entire program. If two members come from different classes, please choose just one of the two classes to make the demonstration. Subject to on-time final submission and plagiarism detection, you will receive the preliminary marks for your demonstration.
You MUST demonstrate your assignment in Week 6 or Week 7 and make your final code submission by 11:59pm September 09 (Friday) 2016.
3
Final Submission
Final code submission should be made via WebLearn by 11:59pm September 09 (Friday) 2016. In line with the standard CSIT policy, late submissions will incur a penalty of 10% of the total score (1.5 marks) per day. Submissions made 5 days after the due date will receive no marks, and all preliminary demonstration marks will be forfeited.
To submit, archive your files into a single .zip file and then upload it to WebLearn.
group.txt – a text file with each member’s student number and full name,
ipa1.py – your final code.
Only one group member needs to make the final submission. If you work individually, you should still include the group.txt file to avoid any confusion. You will lose marks if you do not follow the submission instructions.
Extensions will only be permitted in exceptional circumstances. You should backup your code frequently to avoid potential loss of progress. Note that any accidental loss of progress, working while studying, and/or a heavy load of assignments will not be accepted as exceptional circumstances for an extension.
4