Merineth πŸ‡ΈπŸ‡ͺ
Merineth πŸ‡ΈπŸ‡ͺ
CC#
Created by Merineth πŸ‡ΈπŸ‡ͺ on 10/13/2024 in #help
βœ… Factory method
like i sincerely don’t understand this concept. could someone elaborate?
5 replies
CC#
Created by Merineth πŸ‡ΈπŸ‡ͺ on 10/13/2024 in #help
βœ… 'where' constraints
No description
1 replies
CC#
Created by Merineth πŸ‡ΈπŸ‡ͺ on 10/11/2024 in #help
βœ… Can someone explain Delegates to me like i'm 5?
:(
322 replies
CC#
Created by Merineth πŸ‡ΈπŸ‡ͺ on 10/9/2024 in #help
Creating a class Player based on instructions
No description
97 replies
CC#
Created by Merineth πŸ‡ΈπŸ‡ͺ on 10/9/2024 in #help
βœ… WPF Application, renaming
No description
121 replies
CC#
Created by Merineth πŸ‡ΈπŸ‡ͺ on 10/9/2024 in #help
βœ… Help interpreting classes
No description
2 replies
CC#
Created by Merineth πŸ‡ΈπŸ‡ͺ on 10/8/2024 in #help
βœ… What is a concrete class?
And what is the difference between a concrete class and an abstract class?
4 replies
CC#
Created by Merineth πŸ‡ΈπŸ‡ͺ on 10/7/2024 in #help
βœ… Delegates. What are they and what are they used for?
^
375 replies
CC#
Created by Merineth πŸ‡ΈπŸ‡ͺ on 10/3/2024 in #help
Exceptions.
No description
144 replies
CC#
Created by Merineth πŸ‡ΈπŸ‡ͺ on 10/2/2024 in #help
βœ… Exception handling..
namespace Calculator.Model
{
internal class Division
{
public decimal Run(decimal number1, decimal number2)
{
if (number2 == 0)
{
throw new AlexDivideByZeroException();
}

return number1 / number2;
}

}
}
namespace Calculator.Model
{
internal class Division
{
public decimal Run(decimal number1, decimal number2)
{
if (number2 == 0)
{
throw new AlexDivideByZeroException();
}

return number1 / number2;
}

}
}
When the method Run encounters an instance where number2 == 0 i want it to throw an exception BUT i dont want the program to stop. How does that work?
100 replies
CC#
Created by Merineth πŸ‡ΈπŸ‡ͺ on 10/2/2024 in #help
βœ… Different output on same code.
No description
109 replies
CC#
Created by Merineth πŸ‡ΈπŸ‡ͺ on 10/2/2024 in #help
βœ… System.FormatException
No description
9 replies
CC#
Created by Merineth πŸ‡ΈπŸ‡ͺ on 9/30/2024 in #help
βœ… ”base”
public class Person
{
protected string ssn = "444-55-6666";
protected string name = "John L. Malgraine";

public virtual void GetInfo()
{
Console.WriteLine("Name: {0}", name);
Console.WriteLine("SSN: {0}", ssn);
}
}
class Employee : Person
{
public string id = "ABC567EFG";
public override void GetInfo()
{
// Calling the base class GetInfo method:
base.GetInfo();
Console.WriteLine("Employee ID: {0}", id);
}
}

class TestClass
{
static void Main()
{
Employee E = new Employee();
E.GetInfo();
}
}
/*
Output
Name: John L. Malgraine
SSN: 444-55-6666
Employee ID: ABC567EFG
*/
public class Person
{
protected string ssn = "444-55-6666";
protected string name = "John L. Malgraine";

public virtual void GetInfo()
{
Console.WriteLine("Name: {0}", name);
Console.WriteLine("SSN: {0}", ssn);
}
}
class Employee : Person
{
public string id = "ABC567EFG";
public override void GetInfo()
{
// Calling the base class GetInfo method:
base.GetInfo();
Console.WriteLine("Employee ID: {0}", id);
}
}

class TestClass
{
static void Main()
{
Employee E = new Employee();
E.GetInfo();
}
}
/*
Output
Name: John L. Malgraine
SSN: 444-55-6666
Employee ID: ABC567EFG
*/
Is the β€œbase” keyword only used to get the superclasses info?
31 replies
CC#
Created by Merineth πŸ‡ΈπŸ‡ͺ on 9/28/2024 in #help
βœ… Exception handling
I'm trying to understand exceptions but i'm having a hard time. So when an error occurs in my program. For example :
int number = Console.Readline();
Console.Writeline($"{number}");
int number = Console.Readline();
Console.Writeline($"{number}");
If the input here in this case wasn't an integer but a string. The program would crash right? And to prevent it from crashing we use exception handling with try and catch ?
31 replies
CC#
Created by Merineth πŸ‡ΈπŸ‡ͺ on 9/27/2024 in #help
βœ… Is it possible to Parse a string and identify it's type?
I want to scan an index of an array and identify if it's an operator such as (+,-,*) or if it's an operand (doubles). Is this possible?
178 replies
CC#
Created by Merineth πŸ‡ΈπŸ‡ͺ on 9/26/2024 in #help
βœ… Main program input arguments
When i start my program i want the string inside static void Main(string[] args) to contain the string input.txt output.txt. How do i configure this?
10 replies
CC#
Created by Merineth πŸ‡ΈπŸ‡ͺ on 9/26/2024 in #help
βœ… Sharing C# projects with Github/Fork
So I've downloaded the software 'Fork' and i'm able to stage and commit changes to the project. Does anyone know what others have to do in order to access them and also contribute with pull/push?
2 replies
CC#
Created by Merineth πŸ‡ΈπŸ‡ͺ on 9/25/2024 in #help
Design Patterns / Factory Method
No description
122 replies
CC#
Created by Merineth πŸ‡ΈπŸ‡ͺ on 9/24/2024 in #help
βœ… Factory Method Pattern
Does someone have a good explanation or perhaps a link to somewhere where i can learn this? Been trying to find a video or similar but it just doesn't stick :(
153 replies
CC#
Created by Merineth πŸ‡ΈπŸ‡ͺ on 9/23/2024 in #help
βœ… Cohesion vs Coupling?
i’m having a really hard time understanding the difference between them. Anyone got an easy explanation to it?
6 replies