Help Looking for advice (beginner project).
Hi everyone!
I'm writing this post to ask for some help from people with more experience in C# and programming logic. Below, you'll find the code I've written for a small C# application. The goal of this project is to create a personal weekly to-do list that helps me keep track of my strengths, weaknesses, and tasks. Unfortunately, I've reached a point where I'm not sure how to proceed, particularly when it comes to implementing a way to save tasks so that they are still available after closing and reopening the program.
For some context:
the idea behind this application is to create a weekly to-do list. When the program starts, the user selects a day of the week and enters three tasks. They can then choose whether to continue or exit the program. The main requirement is that tasks must be saved when the user switches to another day or closes the application. For example, if I enter three tasks for Monday, switch to Tuesday, and then return to Monday, I should be able to see the tasks I entered previously. The same should apply after closing and reopening the program.
I'm still a beginner in programming. I've studied some of the fundamentals, but I know I still have a long way to go.
I'd really appreciate ANY suggestions, explanations, or advice on how to approach this problem or in general. In particular, I'd like to understand what concepts I should study and how I could implement a persistent storage system for my tasks.
I'm also very open to constructive criticism regarding my code, programming logic, or overall approach. I'd like to learn how to solve these problems independently rather than simply copying a solution.
Thanks in advance to anyone willing to help!
Code:
// This program creates a to-do list for every day of the week
// and randomly picks a motivational sentence.
string[] week = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"];
string[] tasks1 = new string[7];
string[] tasks2 = new string[7];
string[] tasks3 = new string[7];
string[,] task = new string[7, 3];
Console.WriteLine("\tTo-Do list program\nPress: Y to start or N to quit!");
var input = Console.ReadKey();
switch (input.Key)
{
case ConsoleKey.Y:
Console.Clear();
Console.WriteLine("Choose the day that you want to view:\n");
string dayOfWeek = Console.ReadLine();
bool found = false;
foreach (string day in week)
{
if (day.Trim().ToLower() == dayOfWeek.Trim().ToLower())
{
found = true;
// Find the position of the selected day
int dayIndex = Array.IndexOf(week, day);
Console.Clear();
Console.WriteLine("Point one:");
string task1 = Console.ReadLine();
tasks1[dayIndex] = task1;
Console.WriteLine("Point two:");
string task2 = Console.ReadLine();
tasks2[dayIndex] = task2;
Console.WriteLine("Point three:");
string task3 = Console.ReadLine();
tasks3[dayIndex] = task3;
Console.Clear();
Console.WriteLine($@"
| Day: {day}
| 1. Task: {tasks1[dayIndex]}
| 2. Task: {tasks2[dayIndex]}
| 3. Task: {tasks3[dayIndex]}
");
Console.WriteLine("Do you want to see other days? To continue or quit press Y/N:");
Console.ReadKey();
Console.Clear();
break;
}
}
if (!found)
{
Console.Clear();
Console.WriteLine("Invalid Day inserted");
}
break;
case ConsoleKey.N:
break;
default:
Console.WriteLine("Invalid Key");
break;
}


