关于后端:CSIT121系统设计实践

50次阅读

共计 4029 个字符,预计需要花费 11 分钟才能阅读完成。

CSIT121 Assignment 2: Dietary Recommendation System for Australian Dairy IndustryDue Date: Week 9, 24th September 2023, 11.30 pm Marks: 10

1. Objective

The objective of Assignment 2 is to apply the object-oriented design and programming knowledge gained from Week 1 to Week 8 lectures. In this assignment, students will design a Python program using UMLclass diagrams to aid the Australian dairy industry in providing daily dairy and nutrient intake recommendations tailored toindividuals of different genders, ages, and special requirements (refer to Fig. 1).Fig 1. People in different categories and/orwithdifferentrequirementsFig 2. Five healthy food groupsThe proposed Python program should facilitate collecting user information and preferences through user inputs and generate comprehensive diet recommendations, including five food groups, i.e., vegetables, grain foods, meat products, dairy products, and fruits (refer to Fig.2), based on different user categories, e.g., children (Appendix B), adults (Appendix C), and pregnant women (Appendix D) (refer to Fig. 3).Fig 3. Recommended healthy food intake for ChildrenAdditional reference materials is provided in the appendix. The program must gracefully handle unexpected and inappropriate user inputs by utilising Python’s exception-handling mechanisms (i.e., try and except). Furthermore, the program should allow users to import/export recommended diets for printing, reuse, and documentation using file I/O methods. Students are also required to design program tests using the Python unittest module, analyse the test results, and evaluate the code coverage achieved by their tests.

2. Project Description

The Australian dairy industry aims to provide personalized dietary recommendations for individuals based on their gender, age, and specific requirements. In this assignment, students are tasked with designing a Python program that accomplishes the following:

2.1 Design

1. Create a UML class diagram representing the object-oriented design of the Python program.
2. Develop suitable classes and their relationships to capture user information, dietary preferences, and nutritional data based on the provided reference materials.
3. Implement appropriate class attributes and methods to support the functionality of the dietary recommendation system.

2.2 Program Implementation

The general steps for this project are as follows:

1. Collect user information and special requirements through user inputs, e.g., age, gender, whether the woman is pregnant, etc. For different ages and genders, the diet recommendations should be different. Please follow Appendix B, C, and D to implement the diet recommendation design.
2. Generate diet recommendations by considering five food groups (i.e., vegetables, fruits, grain, meat, and dairy products) based on user profiles and preferences.
3. The generated diet recommendations should be text outputs, including the serving sizes of different food groups and specific food types. For example, for a 9-11 year boy, the recommended fruit serving size is 2, and the diet recommendations could be 150g apple and 150g banana (refer to Fig.3).
4. Handle unexpected and inappropriate user inputs using Python's exception-handling mechanisms to ensure the program's stability.
5. Enable users to import/export recommended diets for printing, reuse, and documentation purposes.

2.3 Testing and Analysis

1. Design comprehensive program tests using the Python unittest module to verify the correctness of the implemented functionality. Each class and important static or non-static methods should be tested using the unittest module.
2. Analyze the test results and evaluate the achieved code coverage to assess the effectiveness of the test suite.

3. Submission

Students must submit the following components via the Moodle system:

1. Report: Provide a PDF file (named recommendation_system.pdf) describing the program's functionality, design decisions, and exception handling approach. A UML class diagram must be included to show the object-oriented design of the Python program. (2 marks)
2. Python Program: Submit the complete Python program (named A2.py) implementing the dietary recommendation system, adhering to the specified requirements. (5 marks)
3. Test Cases and Analysis: Submit test cases developed using the Python unittest module, along with an analysis of the test results and code coverage achieved. (2 marks)
4. Demonstrate your solution to your lab tutor during the lab in Week 10. (1 mark)

Note: The report should provide clear instructions on running the program, explain the various functionalities to end-users, and present a comprehensive overview of the implemented solution.

正文完
 0