Question
**Coding help needed** home / study / engineering / computer science / computer science questions and answers / ***c# help needed *** looking for a
**Coding help needed**
home / study / engineering / computer science / computer science questions and answers / ***c# help needed *** looking for a little help with a small problem i am having. i have a ...
Question: ***C# help needed *** looking for a little help with a small problem I am having. i have a proble...
***C# help needed *** looking for a little help with a small problem I am having. i have a problem that requires me to sort through two lists of objects with a loop and then place the different ones in one output then the similar ones in another output does anyone have any suggestions on how to do this? The actual instructions I am given are below Compare two lists of Student objects. Assume the newStudentList is an update of the oldStudentList. There are methods to retrieve both the old list and the new list. Figure and show the following information: Additions to the old list. Changes to the old list. IDs do not change, but for instance, a name might. Removals from old list. Do this in an efficient manner. Create your own methods in the module as needed. Thank you
code below I was given to "start"
Student.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text;
namespace OldandNewStudents { public class Student { // Sample Student class // Each student has a first name, a last name, a class year, and a rank // that indicates academic ranking in the student body.
public string ID { get; set; } public string FirstName { get; set; } public string LastName { get; set; } public string StudentYear { get; set; } public int StudentRank { get; set; }
public Student(string idNumber, string firstName, string lastName, string studentYear, int studentRank) { ID = idNumber; FirstName = firstName; LastName = lastName; StudentYear = studentYear; StudentRank = studentRank; }
public override string ToString() { return ID + " " + FirstName + " " + LastName + " " + StudentYear + " " + StudentRank; } } }
Program.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text;
namespace OldandNewStudents { class Program { static void Main(string[] args) { //Display lists of students Console.WriteLine("Here is the list of old students: "); ShowStudents(GetStudentsOld()); Console.WriteLine("Here is the list of new students: "); ShowStudents(GetStudentsNew());
//Show the additions Console.WriteLine("Here is the list Additions: ");
//Show the changes Console.WriteLine("Here is the list of Changes: ");
//Show the removed students Console.WriteLine("Here is the list of removed students: ");
Console.ReadLine(); }
public static List
public static List
public static void ShowStudents(List
foreach (Student s in stuList) { Console.WriteLine(s); } Console.WriteLine(); } } }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started