All Questions
Tagged with object-oriented c#
443 questions
4
votes
2
answers
157
views
Object Oriented WinForm App
I have started my first foray into object oriented programming and I wanted to find out if what I have done here makes sense:
Pokedex.cs
...
0
votes
3
answers
167
views
Declaring type definition once for all variables
To avoid the use of magic numbers, I created a static class to store some integer values that are represented inside a database. I avoided using enums because I need to cast them every time I use them....
1
vote
1
answer
70
views
Handling HTTP requests in existing Web Api
I am working in a Web Api project that has the following project structure:
Root
Controllers
Orchestrators
Managers
Services
etc
The ...
0
votes
1
answer
247
views
Calling the base method from overriden method to add some functionality
I have a small Linked list program which I created for just brushing up the concepts.
Following is my Node class
...
60
votes
11
answers
14k
views
Sales tax calculator, rejected for being not OOP
I applied for an Application Developer position. They require all their applicants to complete 1 of 3 programming assignments. I picked one for sales tax calculation. It was quite simple.
Write ...
6
votes
1
answer
458
views
C# Snake in Console
I've created Snake in Console. I've tried to make my code as good as I possibly could.
(Code on github: https://github.com/bartex-bartex/SnakeCSharp)
Question
Is my coding style good enough, so I can ...
5
votes
3
answers
1k
views
Simple N Puzzle console game
I am completely new to object oriented programing (OOP). I have also never worked with C# before. The exercise from my book had some requirements that should be ...
3
votes
2
answers
2k
views
Snakes and Ladders OOP
I've created a simple Snakes and Ladders game. The goal is improving my knowledge about OOP.There are some basic rules.
I need to be able to move my token.
The token starts in the square 1.
If the ...
1
vote
1
answer
285
views
Username and Password checker for invalid entries
I'm very new to programming and coding and "wrote" my first program from scratch as an at home exercise after doing some online courses.
My question is not necessarily a problem I'm having ...
4
votes
1
answer
411
views
Abstract base class for binary serialization
Ensuring that some logic is always being run before the user's overriding methods.
I'm writing a library and I have some abstract classes that can be binary serialized (and users can subclass them and ...
3
votes
2
answers
2k
views
Password Validation Class
I created a class designed to validate passwords based on user defined criteria. Each PasswordValidator object objects a minimum and maximum password length, a character blacklist, as well as ...
5
votes
1
answer
432
views
Simple Ellipse Collision Mini Game
I am doing an exercise to help me understand C#and OOP. The exercise is supposed to teach me about ...
2
votes
1
answer
154
views
Saving entity containing complex jsonb column with validation and comparision
I've been a .NET Developer for almost 4 years. I'm stronly learning and trying using design patterns and following SOLID principles for 3 months right now (I know - a little late, but better late ...
10
votes
2
answers
728
views
Clearing up property and field confusion in C#?
I understand that creating public properties that control private fields is good practice because of coupling and encapsulation, although lately I have seen it as such a waste of boilerplate code for ...
16
votes
8
answers
8k
views
Find the first non-repeating character in a string: ("DEFD" → E)
I recently had an interview and got to phase 2 which is a coding assessment. One of the questions was:
Find the first non-repeating character in a string: ("DEFD" --> E)
I didn't pass the coding ...