Program Design in Python

72 阅读7分钟

Program Design in Python Final Project
Last Updated: Jan 2025
Version: 1.0
Abstract:
This document provides an overview of the final project, including its objectives, scope, and key deliverables. Students are required to demonstrates their
understanding of the project requirements and their ability to apply their knowledge and skills in Python programming to solve a real-world Administration of
Customer Service problem.
Program Design in Python Final Project

  1. Key Information
  2. Context Information
  3. lmplementation Instructions
    3.1 The Investor Application
    3.2. Extracting Property Information
    3.3. Currency Exchange
    3.4. Suburb Property Summary
    3.5. Average Land Size
    3.6. Property Value Distribution
    3.7. Sales Trend
    3.8. Identifying a Property of a Specific Price in a Suburb
  4. Important Notes
  5. Submission Requirements
  6. Marking Guide
    Contact Information:
    Email: chiliu@cityu.edu.mo (DO NOT sumbit assignments to this email address)
  7. Key Information
    Mode Description
    Purpose
    This assignment will develop your skills in designing, constructing, and documenting a small Python program according to specific
    programming standards. This assessment is related to (part of) the following learning outcomes: Investigate useful Python
    packages for scientific computing and data analysis; Experiment with data manipulation, analysis, and visualisation techniques to
    formulate business insight.
    Your task
    This assignment is 代写Program Design in Python an individual task where you will write Python code for a simple application whereby you will be developing a
    property investment management system as per the specification.
    Value 50% of your total marks for the unit.
    Due Date Sunday, 19 Jan 2025, 23:59
    Submission Via TronClass System.
    Administration of Customer ServiceMode Description
    Assessment
    Criteria
    The following aspects will be assessed: 1. Program functionality in accordance to the requirements; 2. Code Architecture and
    Adherence to Python coding standards; 3. The comprehensiveness of documented code and test strategy
    Submission Via TronClass System.
    Late Penalties Submissions after the due date will receive a mark of ZERO (0) without any argument acceptable.
  8. Context Information
    You are working as a developer in a property investment company located in Melbourne, Australia. Your company is providing services for customers from
    all over the world to invest in properties in Melbourne. As your company grows, the management team has discovered that some of the administrative
    tasks are time-consuming and repetitive. Therefore, as the only developer in this company, your task here is to automate some of these administrative
    tasks. To test your implemented functionalities, you are provided a CSV file which contains information about the properties sold in some suburbs from
    2010 to 2023.
  9. lmplementation Instructions
    Your implementation must include a text interface (a text interface is the least requirement) with functionalities detailed below. Your program will be
    evaluated based on its clarity, including the provision of clear information and error messages. Your program should handle exceptions properly and handle
    unexpected cases wherever necessary. The validation of data types and values should be done within each functionality.
    To ensure that your code can be properly evaluated by the teaching team:
  10. Please ensure that your implemented methods use the same names and method signatures (i.e., number and type of input arguments and the type of
    the return value) as required.
  11. Please ensure that your code is properly formatted, such as proper variable naming conventions, consistent indentations, proper line length, etc.
  12. Please ensure that you provide clear and coherent comments on your code to aid with the graders' interpretation of your code.
  13. For more details regarding formatting and commenting, see the PEP 8 Style Guideline.
    3.1 The Investor Application
    You are required to use object-oriented programming to implement the text interface and the following functionalities described from 3.2 to 3.8, which
    allows users to select and perform certain operations. You should determine the proper number of classes needed instead of including all the
    methods in one class (for example, you may create a class 1)  SimpleDataAnalyser  to deal with the loading of data as well as the simple analyses;
  1.  DataVisualiser  to deal with the visualisations; and 3)  Investor  to display a menu, ask for and process user inputs, etc.). Please make sure to
    create a  main.py  file to run your implemented text interface. You should also provide an instruction file in PDF format, which is no more than two pages in
    length, to describe the usage of the interface. For each functionality from 3.2 to 3.8, we list a core method as shown below. Note that for these core
    methods described below, you should use the same method name and include the same method parameter. The only permitted modification is
    to add the  self  keyword to the methods.
    3.2. Extracting Property Information
    The  extract_property_info(file_path)  method is responsible for reading the property information from the data file located at the specified  file_path .
    This method returns a dataframe.
    3.3. Currency Exchange
    Since many of the customers are from different countries, the  currency_exchange(dataframe, exchange_rate)  method is responsible for transforming the
    property prices in Australian dollars into the target currency according to the exchange rate. The variable  dataframe  is the one returned in 3.1, and the
    data type of  exchange_rate  is float. This method returns a NumPy array of transformed prices.
    3.4. Suburb Property Summary
    The purpose of this method is to display the summary of the properties with respect to the number of bedrooms, number of bathrooms, and number of
    parking spaces for a given suburb. Your task is to write a method  suburb_summary(dataframe, suburb)  where  dataframe  is the one returned by the method
    described in 3.1, and  suburb  is the target suburb to be analysed. Here, if the value of  suburb  is "all", the method should display the summary from allthe suburbs. If the value of  suburb  does not exist in the  dataframe , an error message should be displayed. The summary should at least include the mean
    values, standard deviation, median, minimum, and maximum. This method does not have a return value.
    3.5. Average Land Size
    Your task here is to implement the method  avg_land_size(dataframe, suburb)  where  dataframe  is the one returned by the method described in 3.1, and
    suburb  is the target suburb to be analysed (or all suburbs if the value of  suburb  is "all"). This method calculates and returns the average land size in m² of
    properties in the suburb (or None if the area does not exist). Note that the invalid land size values should be excluded and the units must be in square
    meters for some properties.
    3.6. Property Value Distribution
    Here, you will be visualising the property values as a histogram so as to easily present to the customers. You are provided a dictionary of key-value pairs
    where the keys are the names of the currency and the values are their exchange rates to Australian dollars, which you can use as a local variable within
    this method:
    currency_dict = { "AUD": 1, "USD": 0.66, "INR": 54.25, "CNY": 4.72, "JPY": 93.87, "HKD": 5.12, "KRW": 860.92, "GBP": 0.51, "EUR": 0.60, "SGD": 0.88 
    Your task is to write a method  prop_val_distribution(dataframe, suburb, target_currency)  which:
    Takes the following parameters:
    A dataframe
    A suburb value
    A target currency (whose default value is "AUD")
    Converts the property value into the target currency if the currency is in the  currency_dict . In cases where the target currency does not exist in the
    currency_dict , the program needs to inform the user and generate the histogram in AUD.
    Produces a graphical representation (i.e., a histogram) of the property value distribution of the specified suburb (or all suburbs if the value of suburb is
    "all") based on the converted property values and saves the graphical representation as a file.
    In cases where the target suburb does not exist in the  dataframe , the program should inform the user and generate the histogram with all suburbs
    and save the graph as a file.
    Note that the records with missing price values should be excluded.
    You will need to invoke methods implemented in previous steps. This method does not have a return value.
    3.7. Sales Trend
    Here, you will need to calculate the number of properties sold in each year and visualise the results as a line chart so that a sales trend can be easily
    observed. The line chart should be saved as an image file locally.
    Your task is to implement the method  sales_trend(dataframe)  where  dataframe  is the one returned by the method described in 3.1. The method does not
    have a return value.
    3.8. Identifying a Property of a Specific Price in a Suburb
    Your task here is to implement the  locate_price(target_price, data, target_suburb)  method to find out if a specific  target_price  value is in the list of
    prices from a specific  suburb . In the variable  data  is a dataframe loaded by a previous method. You should filter the data according to the variable
    target_suburb  to get the list of prices for the properties in the  target_suburb . The variable  target_price  is a numeric value. This method first sorts the
    list of prices using a reverse insertion sort (i.e., an insertion sort algorithm that sorts the list in descending order). Then this method searches for the
    target_price  value within the reversely sorted list of prices using recursive binary search. A boolean value of True or False will be returned by this
    method to indicate if the  target_price  value can be found in the list of prices filtered for the  target_suburb .
  1. Important Notes
    If any exceptions/errors happen when running your program and are not properly handled, you will lose 50% of the functionality where the
    exceptions/errors occur. For example, if the total mark of one functionality is 10 marks and any exception happens when running this functionality
    which causes the program to terminate, then the maximum mark you can get is 5 instead of 10.
    Add correct validation and output messages to make your code more user-friendly to users.
    For each function listed in 3.2 to 3.8, add code to test each functionality and also the expected behaviour. The test code should be placed in the
    main.py  file as comments. For example, if you have created a class named  DataExtractor  where  extract_property_info(file_path)  is an instance
    method:de = DataExtractor()
    df = de.extract_property_info("property_information.csv")
    len(df)

this should output 118771

This is an individual assignment and must be completed on your own. You must attribute the source of any part of your code that you have not written
yourself.
The assignment must be done using PyCharm or VSCode, Python >= 3.10.
The Python code for this assignment must be implemented according to the PEP 8-Style Guide for Python Code.
The allowed libraries are  OS ,  NumPy ,  Pandas ,  Matplotlib ,  Scikit-learn , and  SciPy . You will receive penalties if you use any other libraries. If you
are implementing unit tests, you are allowed to use  unittest .
Commenting on your code is an essential part of the assessment criteria. In addition to inline and function commenting on your code, you should
include comments/markdowns at the beginning of your program file which specify your full name, student ID, the creation date, and the last modified
date of the program, as well as a high-level description of the program.
Please be careful to ensure you do not publicly post anything which includes your reasoning, logic or any part of your work to this forum. This includes
posting your query to the forum and inviting other students to raise questions that may reveal your reasoning or solution.
5. Submission Requirements
The assignment must be submitted by Sunday, 19 Jan 2025, 23:59.
The following files are to be submitted on TronClass:
The  .py  files that you created to implement your assignment (i.e., code and documentation). Note that you should properly name these files to make
sure their usage is self-explanatory.
An instruction file that explains the detailed design, usage and use cases of the program. Name the file  [StudentNameInChinese]_report.pdf . The
instruction file should be coherent,concise and illustrated, and should not be more than 5 pages in length.
The above files must be compressed to a  .zip  file named  [StudentNameInChinese]_final_project.zip  and submitted via TronClass.
No submissions will be accepted via email.
It is your responsibility to ENSURE that the submitted files are the correct files. We strongly recommend after uploading a submission that you check
its contents.
There are no restrictions on creating extra functions. DO NOT create redundant functions/methods.
Marks will be deducted for any of these requirements that are not strictly complied with.
6. Marking Guide
Your work will be marked as per the following:
Method Functionalities - 75 Marks
Extracting Property Information - 2 Mark
Currency Exchange - 6 Marks
Suburb Property Summary - 10 Marks
Average Land Size - 10 Marks
Property Value Distribution - 18 Marks
Sales Trend - 15 Marks
Identifying Price Value - 14 Marks
OOP Implementation and Main Logic - 25 Marks
Proper design of classes
Clear usage manual
Clear instructional messages
Good alignment to PEP 8 style
Detailed test codes
Good program logic
Penalty - up to 20 marks
Missing requirements listed in Section 4. Do and DO NOT and section 5. Submission Requirements.
Total: 100 marks, recorded as a grade out of 50

WX:codinghelp