Skip to content

Mostafa-SAID7/list-selection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

10 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“‹ List Selection Program in C#

This is a simple yet functional C# console application that lets users manage a list of numbers through a text-based menu. It supports adding, displaying, sorting, and analyzing numeric data.


πŸ” Overview

πŸ” Control Flow Structures Used

  • while loop
  • switch statement
  • if / else statements
  • for loops

πŸ› οΈ Methods and Functions Used

  • Console.WriteLine() / Console.Write()
  • Console.ReadLine()
  • Convert.ToInt32(string)
  • List from System.Collections.Generic

Supports methods such as:

  • Add() – adds a number to the list.
  • Clear() – empties the list.
  • Count – gets the current number of items.
  • Contains() – checks for duplicates.

⚠️ Built-in LINQ methods such as .Sort(), .Min(), .Max(), .Avg(), and .Find() are not used β€” all logic is implemented manually.


🎯 Features

  • P - Print numbers in the list
  • A - Add a number (prevents duplicates)
  • M - Calculate mean of the list
  • S - Find smallest number
  • L - Find largest number
  • F - Find a number by value and display its index
  • C - Clear the list
  • T - Toggle sort order (Ascending / Descending)
  • D - Display current sort order
  • Q - Quit the application

πŸš€ How to Run

Run via .NET CLI:

git clone https://github.com/Mostafa-SAID7/list-selection.git
cd list-selection
dotnet run

You can also run it from Visual Studio or Visual Studio Code by opening the folder and pressing F5 or using the terminal.

πŸ’‘ Learning Goals

This project helps you:

  • βœ… Practice list manipulation in C#
  • βœ… Implement manual sorting (bubble sort logic)
  • βœ… Handle user input using switch-case statements
  • βœ… Think algorithmically about calculating mean, minimum, and maximum without built-ins

🧩 Potential Add-ons

Consider adding the following to enhance the project:

  • πŸ” Swap two elements by index
  • ↩️ Undo the last action (add or remove)
  • πŸ’Ύ Save/load list from a file
  • πŸ–ΌοΈ Create a GUI version using WinForms or WPF
  • πŸ“€ Export the list to a .csv or .json file

πŸ›  Requirements

  • .NET 6.0 SDK or later
  • An IDE or editor such as:
  • Visual Studio
  • Visual Studio Code (with the C# extension)
  • Or a simple terminal for running with dotnet run

πŸ“ How to Use This README

To integrate this documentation into your GitHub project: In your project root directory, create a file named README.md. Copy and paste all of this text into that file. Save the file.

Commit and push it to your GitHub repository using the following commands:

git add README.md
git commit -m "Add full project documentation"
git push origin main

Once pushed, GitHub will automatically render the README.md on the repository homepage.

πŸ‘€ Author

Mostafa SAID

πŸ“„ License

This project is licensed under the MIT License.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages