From 099df1b2ad941d29d425344ec2fc4983b19b4617 Mon Sep 17 00:00:00 2001 From: jobrod <jobrod@taltech.ee> Date: Tue, 11 Mar 2025 17:31:20 +0200 Subject: [PATCH] Add new file --- HW1Algorithm.txt | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 HW1Algorithm.txt diff --git a/HW1Algorithm.txt b/HW1Algorithm.txt new file mode 100644 index 0000000..6ce489e --- /dev/null +++ b/HW1Algorithm.txt @@ -0,0 +1,25 @@ +Algorithm: +Define Structures: + +Define the Student structure with attributes: student_code, name, and id_code. +Define the Resident structure with attributes: id_code and city. +Read Data from Files: + +Read data from F1.txt and store it in an array of Student structures. +Read data from F2.txt and store it in an array of Resident structures. +User Input: + +Prompt the user to input a string Residence. +Match Students: + +Iterate through the list of students and residents. +For each student, check if their id_code matches the id_code of any resident with the given Residence. +If a match is found, add the student to the list of matching students. +Output Results: + +Check if there are any matching students. +If there are matching students, print their details (Student Code, Name, ID Code). +If no matching students are found, print a message indicating that no students were found with the given residence. +Program Termination: + +After printing the results, terminate the program. -- libgit2 0.25.0