Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

SENG265

Summer 2022

Assignment4

Programming environment

For this assignment you must ensure your work executes correctly on the virtual machines (i.e., Senjhalla or its  analogous environment for students with M1 MacBooks) you installed/configured as part of Assignment 0 as this is our “reference platform” . This same environment will be used by the teaching team when grading the work   submittedbythe SENG265 students. Submitted assignmentthatdon’texecutecorrectlyontherequired     environment will receive a failing grade or be subject to heavy penalties.

The samplecodefor Part1 ofthisassignmentisavailableonBrightspaceaswellason the a3’ folder of your git repository and you must use the git pull command to download a copy of the files. Make sure that  your submitted files are inside of your a4 folder of your cloned Git repository.

Hint: Toverify whether you uploaded the files properly, simply clone the git repository to a new directory on your computer and check that the desired files are placed properly.

Individual work

This assignment is to be completed by each individual student (i.e., no group work). Naturally you will want to discuss aspects of the problem with fellow students, and such discussion is encouraged. However, sharing of code fragments is strictly forbidden. Code-similarity analysis tools are used to check submitted work for plagiarism.

Learning objectives

I.      Learn object-oriented design with Python  using classes, objects, and attributes (methods and data).

II.     Appreciate the concepts of abstraction and encapsulation

III.      Learn how to structure Python projects into multiple files ― packages and modules.

IV.      Learn Python type hinting

V.      Learn how to generate random numbers in Python

VI.      Learn how to manipulate sequential text files using functions in Python

VII.      Learn how to understand application programmer interfaces (APIs)

VIII.      Learn how to generate HTML5 and SVG code programmatically

IX.      Learn top-down design using function decomposition

X.     Appreciate how you can configure Python programs with a configuration class.

XI.      Continue to learn incremental development. The starting point for A4 is a complete Python program. You need to study and understand this program to complete the assignment.

XII.      Learn how to read and understand existing code and build upon it.

XIII.      Use Git to manage changes in your source code and annotate the evolution of your solution with      messages provided during commits. Update your git repository after every major editing session to make sure that you don’t loose your work.

Instructions

Assignment4 consistsofthree(3)separatePythonprojects.The ideaistodevelopthefamous SENG265    Python Arts program incrementally. All three parts are required. The first two parts are worth 20% each and Part 3 is worth 60%. Store the three different Python projects in three subdirectories called a41, a42, a43of the a4  directory.

Part 1

The purpose of Part I is to figure out the process of writing an HTML/SVG file and viewing this file in a web   browser.  So in Part 1 you are to develop an object-oriented Python project that features a Circle class and       generates an HTML-SVG fileasdepictedinFigure1 below.Viewingthisfileinawebbrowserwillrenderthe     SVG drawing depicted in Figure 2 below. Start Part 1 by downloading this sample Python program provided and    modify this program as follows. Create classesforthe geometric objects(i.e., Circle (provided), Rectangle) as  well as a class called ProEpilogetogeneratetheHTML/SVG prologueandepilogue. The class names          Circle,Rectangle,andProEpilogueare required for Part 1 for automated grading. Part 1 must generate and draw circles and rectangles (e.g., at least 20). Please note that there are no random numbers         required for Part 1 (i.e., you can hardwire in your code all the numbers that appear in Fig. 1           below).

 

Figure 1: Generated HTML/SVG code

 

Figure 2: Sample HTML/SVG page

Part 2

Part 2 generates random numbers using a class called GenRandom (cf. Table 1) for generating random art using an art range configuration class called ArtConfig (cf. Figure 3) that can be instantiated to create different art    types such as the images depicted in Figure 3 below. The output of Part 2 must be a table of random numbers as depicted in Table 1 below. Please note that not all columns are required for Part 3 but are required for Part 2.   Also notethattherandom numbersyougenerate willof coursebedifferentthanthenumbersinTable1.     However, the random numbers should be within the ranges specified inTable 2 below. The numbers should be  arrangedinnicelyaligned(right-justified)columns.There arenorequirementswithrespecttowhitespace.The class names GenRandom and ArtConfig are required for Part 2 for automated grading.

Table 1: Random numbers for 10 sample geometric shapes

 

Table 2: Random numbers for 10 sample geometric shapes

 

Part 3

The goalof Part3 istointegratetheclassesdevelopedforParts1 and 2 intoathirdPythonprojectand     generate some beautiful greeting cards for your friends and family in the form ofHTML-SVG pages. That is,   Projects 1 and 2 are test programs for the various classes required for Part 3. Instantiate three configuration class objects to generate different art types as depicted in Figure 3 below. Image titles and captions are optional. All  the class names required for Parts 1 and 2 are required for Part 3. 

 

Figure 3: SENG 265 ART

Important requirements for grading

    Your Python projects must execute perfectly under the Senjhalla virtual machine.                       The most important grading requirements are effective object-oriented design and effective program

decomposition.

    You must use classes and objects for geometric objects (i.e., Circle, Rectangle), art configuration (i.e.,

ArtConfig) as well as HTML-SVG prologue and epilogue (i.e., ProEpilogue)

    To facilitate automated grading

o the following call names are required for the required classes: Circle, Rectangle, ProEpilogueArtConfig, and GenRandom

o eachclassandeachmethodmusthaveadocstringcontainingtheclassormethodname(e.g., “““Circle class ””” or “““ drawCircle method ”””) right below the class or function   header

o all three projects must have a main() function

o for Projects 1 and 3, generate valid, multi-line, and indented HTML-SVG files

o all three projects must use Python type hints.

o all three projects must include at three useful doctests (e.g., cf. Exam C solutions)

o for all three projects, global, program-scope, or file/module-scope variables must not be used.

What to submit

    Submit all three parts in separate directories/folders to your a4 folder of your Git repository as follows.     The threedifferentPythonprojects mustbestored inthreesubdirectories/folderscalleda41, a42,a43

that are in your a4 directory.

    Hint: Toverify whether you uploaded the files properly, simply clone the git repository to a new

directory on your computer and check that the desired files have been placed properly.

    Part 1: Submit your Python program (a41.py) as well as the generated HTML file (a41.html)                Part2:Submit yourPythonprogram (a42.py)as wellasa screenshotofyour randomtable (a42.jpg)      Part 3: Submit your Python program (a43.py) as well as three screenshots of your art (a431.jpg, a432.jpg,

and a433.jpg)

Grading assessment

    The first two parts are worth 20% each and Part 3 is worth 60%.

    Straying from the assignment requirements will result in zero marks due to automated grading.

Additional Criteria for Qualitative Assessment

•    Documentation and commenting: the purpose of documentation and commenting is to write informationso that anyone other than yourself (with knowledge of coding) can review your program and quickly understand how it works. In terms of marking, documentation is not a large mark, but it will be part of the quality      assessment.

•    Proper naming conventions: You must use proper names for functions and variables. Using random or single character variables is considered improper coding and significantly reduces code readability. Single character variables as loop variables is fine.

•    Debugging/Comment artifacts: You must submit a clean file with no residual commented lines of code or unintended text.

•    Quality of solution: marker will access the submission for logical and functional quality of the solution. Some examples that would result in a reduction of marks