Sprint Challenge: Task Management System
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
Bắt đầu bằng cách tạo các package tasks, management và main được mô tả trong issue, với Task và các kiểu task chuyên biệt, TaskManager và Main. Sử dụng các yêu cầu và tiêu chí chấp nhận được liệt kê để định hướng thiết kế, sau đó chạy Main để xác minh việc tạo và hoàn thành task, các bản tóm tắt đa hình và việc ngăn chặn các trạng thái không hợp lệ.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Sprint Challenge: Task Management System
The code you write for this challenge is mandatory homework and should be completed and sent in a PR for review before class.
This challenge combines all the object-orientated programming concepts you've learned so far. You'll see how classes, encapsulation, inheritance, polymorphism, packages, and static/final keywords form a cohesive system for building well-structured Java applications.
Background
You are working for a company that wants to track different types of tasks in a project. Each task has a description, a unique identifier, and a completion status. Some tasks have special behaviour or additional data, such as deadlines or priority levels.
Your job is to create a small system that models tasks, enforces valid state, and allows tasks to be managed using polymorphism.
Requirements
Design a system that models tasks, manages them, and prints a simple summary of task states to the console.
Task Behaviour
All tasks should:
- Have a unique identifier
- Have a human-readable description
- Be able to be completed
- Prevent invalid states, e.g. cannot be completed twice
Specialised Task Types
The system must support at least two specialised task types. These types should:
- Inherit from the base Task class
- Add additional state or behaviour of their own
- Behave differently at runtime when treated as a generic Task
Some examples could be a timed task with a deadline, or priority task with prioritisation
Task Management
Create a TaskManager class responsible for:
- Storing tasks (using a fixed-size array, e.g. max 10 tasks)
- Adding new tasks
- Completing tasks by ID
- Returning tasks based on completion status
- The TaskManager should not need to know concrete task types
Code Organisation
Your code should be organised into multiple packages:
- tasks → contains Task and specialised task types
- management → contains TaskManager
- main → contains Main class with a main method to demonstrate behaviour
Acceptance Criteria
The system should:
- Log task summaries to the console in a human-readable format
- Show each task's ID, description, type, and completion status
- Demonstrate polymorphism at runtime (e.g., calling overridden methods on different task types without checking type)
- Prevent any task from entering an invalid state
- Compile and run without errors
- Use proper encapsulation (no public fields)
- Use final or static where appropriate
Main method expectations:
- Create a TaskManager
- Add several different task types
- Complete some tasks
- Print task summaries to the console
Developer Guidance (May just use for reference)
Let's start by modelling the data:
Class Task
- Fields:
- private final int id (unique)
- private String description
- private boolean completed
- Methods:
- public void complete() → mark as completed, prevent double-completion
- public String getStatus() → returns a human-readable status
- Consider using static for generating unique IDs
Specialised Tasks
- Create at least two subclasses (e.g., TimedTask, PriorityTask)
- Add additional fields (e.g., deadline, priority)
- Override methods to demonstrate polymorphic behaviour
TaskManager
- Fields:
- private Task[] tasks
- private int taskCount
- Methods:
- public void addTask(Task task)
- public void completeTask(int id)
- public Task[] getTasksByStatus(boolean completed)
Main
- Create a simple demo of your system, showing tasks being added, completed, and summaries printed
Reflection Questions
- Where did polymorphism remove the need for conditional logic?
- Which responsibilities are shared across all tasks, and which are specific?
- Where did encapsulation prevent misuse of an object?
- If a new task type were added, how much existing code would need to change?
Submission & Review
Fork the coursework repo to your own GitHub account.
Make regular small commits with clear messages.
When you are ready, open a Pull Request to the CYF repo. Make sure you fill in the PR template provided.
A volunteer will review your submission and send you feedback.
- Ngôn ngữ chính
- Không có dữ liệu ngôn ngữ
- Star
- 1
- Fork
- 11
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của CodeYourFuture/Module-Java
-
🎯 Topic Programming Fundamentals 🏕 Priority Mandatory 🐇 Size Small 📅 Sprint 1 Core
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
-
🎯 Topic Programming Fundamentals 🏕 Priority Mandatory 🐇 Size Small 📅 Sprint 1 Core
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
-
Sprint 7 - Sprint Challenge 2 Đang mở🎯 Topic Programming Fundamentals 🏕 Priority Mandatory 🐂 Size Medium 📅 Sprint 7 Core
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
-
Sprint 7 - Challenge 1 Đang mở🎯 Topic Programming Fundamentals 🏕 Priority Mandatory 📅 Sprint 7 🦑 Size Large Core
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 45/100
-
Sprint 6 Challenge Đang mở🎯 Topic Programming Fundamentals 🏕 Priority Mandatory 📅 Sprint 6 🦑 Size Large Core
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
Tất cả issue của CodeYourFuture/Module-Java
Issue tương tự
-
货币战争手改优先级配置缺少列表元素类型校验(P3) Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
syfoud/Simulated_Scepter#172 ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 82/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
crossplane/crossplane#7859 ·
-
bot:ai-assisted component:compact-js status:untriaged
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
midnightntwrk/midnight-sdk#403 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
nightscout/nocturne#1379 ·