C#C
C#10mo ago
DripSwagon

C# ASP.NET -> Linked List problems

Hello everyone, I am a Course 1 student in the second semester and I am struggling with Linked Lists, I won't be ashamed to say that I used ChatGPT for this task, because this type of List is new to me and I can't quite fully grasp it yet. I would like to ask for help, my code fails and I don't understand why, if anyone could help me understand / give me advice on how better I could complete my task, or help me find my problem I would really appreciate it. <3

Here is the summary of my task:

There are n (1 ≤ n ≤ 100) points of m (1 ≤ m ≤ 256) colors in a rectangular coordinate plane. By connecting points in groups of three, many triangles can be formed. The colors for which you can try to form triangles are specified in the next file. Write a program that, if possible, would find three points among the points of each color, which, when connected together, would form the largest isosceles
triangles. Calculate the perimeters of the resulting triangles.
Data:
  • The text file U5a.txt contains data about the points. The colors of the points and
    the coordinates (x; y – integers) (-100 ≤ x, y ≤ 100) are listed in lines. The color name can consist of
    two words.
  • The text file U5b.txt contains a list of colors and instructions. The colors are listed in a column, next to the color name the word "yes" means that it is possible, and the word "no" means that it is not possible.
    Print the color name, coordinates, perimeter or "not available" or "not possible". Sort the colors and coordinates from which triangles were successfully formed by colors in alphabetical order and perimeters in ascending order. Sort the colors from which triangles were unsuccessfully formed by colors in alphabetical order. Implement the removal of invalid triangles (invalid coordinates are entered using the keyboard) from the list.
Thank you for reading!
image.png
Was this page helpful?