Array Deletion at End
📖 Scenario: You are managing a list of daily tasks in a simple to-do app. Sometimes, you finish the last task and want to remove it from the list.
🎯 Goal: Build a program that stores a list of tasks in an array and removes the last task when it is completed.
📋 What You'll Learn
Create an array called
tasks with exactly these strings: "Laundry", "Dishes", "Homework", "Exercise"Create an integer variable called
currentLength to track how many tasks are in the arrayWrite code to remove the last task by decreasing
currentLength by 1Print the tasks remaining in the array up to
currentLength in order, separated by " -> "💡 Why This Matters
🌍 Real World
Managing lists of items where you add or remove tasks, messages, or entries is common in apps and software.
💼 Career
Understanding how to manipulate arrays and track their size is a basic skill for software developers working with data collections.
Progress0 / 4 steps
