How ande930331/final-report works
Project type and purpose
• This is a simple command-line Python tool whose sole purpose is to determine whether a given Gregorian year is a leap year.
• There is no frontend/backend split, no persistent datastore, and no external API calls—just a single script (year.py) and a README.
File structure
• Top level:
• README.md – project description, usage examples
• year.py – the Python script containing both the CLI logic and the leap-year function
• No additional directories, no config files, no tests folder.
README for additional insights
• The README shows the problem statement, the is_leap_year function definition, and sample inputs/outputs.
• No mentions of frameworks, packaging, or deployment.
Main components
a. Actor: “User” (the person typing a year into the console)
b. Component: “CLI Interface” (the input() call and print statements in year.py)
c. Component: “LeapYearService” (the is_leap_year(year) function implementing the rule)
d. Environment: “Python Interpreter” (the runtime executing year.py)
Relationships and interactions
• User → CLI Interface: enters a year
• CLI Interface → LeapYearService: passes the integer year to the function
• LeapYearService → CLI Interface: returns True/False
• CLI Interface → User: prints “閏年” or “平年”
Architectural patterns and design principles
• Single-module, procedural pattern
• Clear separation between “input/output handling” (CLI) and “business logic” (leap-year calculation)
• Easily extensible: the is_leap_year function could be extracted into a library module in the future
Relevant technologies
• Python 3.x standard library only
• No external dependencies
Essential details to capture
• Separation of concerns: I/O vs. logic
• Execution environment (Python Interpreter)