kryca
kryca
CC#
Created by kryca on 3/12/2023 in #help
❔ Need help with Node LinkedLists
Will try that, cheers for the help
15 replies
CC#
Created by kryca on 3/12/2023 in #help
❔ Need help with Node LinkedLists
public static void PrintAgentsWithSubscribers(LLAgent agents, LLSubscriber subscribers)
{
Node<Agent> agentNode = agents.head;
while (agentNode != null)
{
Console.WriteLine("Agent: {0} {1}", agentNode.Data.Surname, agentNode.Data.Name);
Console.WriteLine("Assigned Subscribers:");
Node<Subscriber> subscriberNode = subscribers.head;
while (subscriberNode != null)
{
if (subscriberNode.Data.AgentCode == agentNode.Data.Code)
{
Console.WriteLine("{0}", subscriberNode.Data.Surname);
}
subscriberNode = subscriberNode.Next;
}
Console.WriteLine();
agentNode = agentNode.Next;
}
}
public static void PrintAgentsWithSubscribers(LLAgent agents, LLSubscriber subscribers)
{
Node<Agent> agentNode = agents.head;
while (agentNode != null)
{
Console.WriteLine("Agent: {0} {1}", agentNode.Data.Surname, agentNode.Data.Name);
Console.WriteLine("Assigned Subscribers:");
Node<Subscriber> subscriberNode = subscribers.head;
while (subscriberNode != null)
{
if (subscriberNode.Data.AgentCode == agentNode.Data.Code)
{
Console.WriteLine("{0}", subscriberNode.Data.Surname);
}
subscriberNode = subscriberNode.Next;
}
Console.WriteLine();
agentNode = agentNode.Next;
}
}
So something along the lines of this should work now
15 replies
CC#
Created by kryca on 3/12/2023 in #help
❔ Need help with Node LinkedLists
15 replies
CC#
Created by kryca on 3/12/2023 in #help
❔ Need help with Node LinkedLists
public static void PrintAgentsWithSubscribers(LLAgent agents, LLSubscriber subscribers) { Node<Agent> agentNode = agents.Head; while (agentNode != null) { Console.WriteLine("Agent: {0} {1}", agentNode.Data.Surname, agentNode.Data.Name); Console.WriteLine("Assigned Subscribers:"); Node<Subscriber> subscriberNode = subscribers.Head; while (subscriberNode != null) { if (subscriberNode.Data.AgentCode == agentNode.Data.Code) { Console.WriteLine("{0} {1}", subscriberNode.Data.Surname, subscriberNode.Data.Name); } subscriberNode = subscriberNode.Next; } Console.WriteLine(); agentNode = agentNode.Next; } } Something along the lines of this was my first thought, but .Head is private and im not so sure i can change it to public
15 replies
CC#
Created by kryca on 12/6/2022 in #help
❔ How do i count how many different vowels are in a string?
ye nvm mixed up the names of the text files...
66 replies
CC#
Created by kryca on 12/6/2022 in #help
❔ How do i count how many different vowels are in a string?
n is 5, my text file has 7 lines
66 replies
CC#
Created by kryca on 12/6/2022 in #help
❔ How do i count how many different vowels are in a string?
66 replies
CC#
Created by kryca on 12/6/2022 in #help
❔ How do i count how many different vowels are in a string?
66 replies
CC#
Created by kryca on 12/6/2022 in #help
❔ How do i count how many different vowels are in a string?
Aight, thanks a lot for the help :D
66 replies
CC#
Created by kryca on 12/6/2022 in #help
❔ How do i count how many different vowels are in a string?
oh wait no
66 replies
CC#
Created by kryca on 12/6/2022 in #help
❔ How do i count how many different vowels are in a string?
would lines.ReadAllLines(filename); work to fill up the list?
66 replies
CC#
Created by kryca on 12/6/2022 in #help
❔ How do i count how many different vowels are in a string?
two 'for' cycles
66 replies
CC#
Created by kryca on 12/6/2022 in #help
❔ How do i count how many different vowels are in a string?
or is it easier in c# ?
66 replies
CC#
Created by kryca on 12/6/2022 in #help
❔ How do i count how many different vowels are in a string?
okay so treat the lines of the text as an array and then simply make space for a line at the start with double for ?
66 replies
CC#
Created by kryca on 12/6/2022 in #help
❔ How do i count how many different vowels are in a string?
its a weird task with a bit of limitations, but to put it simply, find the longest word in a text file, move that line that has the longest word to the top
66 replies
CC#
Created by kryca on 12/6/2022 in #help
❔ How do i count how many different vowels are in a string?
pretty much instead of moving 2 i need to move 1 only
66 replies
CC#
Created by kryca on 12/6/2022 in #help
❔ How do i count how many different vowels are in a string?
say these are the lines 1 yes 2yup 3 maybe 4 no this should be the output: 3 maybe 1 yes 2yup 4 no
66 replies
CC#
Created by kryca on 12/6/2022 in #help
❔ How do i count how many different vowels are in a string?
all the lines asides from the one i want to move up should stay in the same position
66 replies
CC#
Created by kryca on 12/6/2022 in #help
❔ How do i count how many different vowels are in a string?
i know how to split text into lines words etc, how do i move it to the top though
66 replies
CC#
Created by kryca on 12/6/2022 in #help
❔ How do i count how many different vowels are in a string?
Another question then, say i have 3 lines of text, and i want to move the 2nd line all the way to the top, how should i approach this ?
66 replies