C# ASP.NET Core 3 - Voting System - Ep1 - Naive Solution - (Beginner Tutorial)

C# ASP.NET Core 3 - Voting System - Ep1 - Naive Solution - (Beginner Tutorial)

Raw Coding

4 года назад

15,905 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@janne_kekalainen
@janne_kekalainen - 19.12.2021 16:01

One thing I just discovered. Just like you can put an "f" at the end of a number to make it a float, you can also put a "d" to make it a double.

Ответить
@KaRtEiRo93
@KaRtEiRo93 - 28.09.2021 17:55

how can you write a code that has like 4 candidates and counts the number of votes for each candidate and not percentages?

Ответить
@anatoliytkachenko1498
@anatoliytkachenko1498 - 02.05.2021 13:41

like!

Ответить
@MrJeeoSoft
@MrJeeoSoft - 06.11.2020 23:41

Thanks for the tutorial!

Ответить
@dnkreative
@dnkreative - 03.11.2020 19:13

with swapped multiplication and division in percentage computation it should work with integers

Ответить
@TheLaubum
@TheLaubum - 18.10.2020 04:38

Starting programmer here, when you challenged us to think of the logic for the results I paused the video like you suggested and tried to do it myself.
First I wanted to use an And statement but I immediately failed because I don't know the syntax for it.
So I resumed the video to maybe see that syntax but instead you started nesting If statements, so I paused and tried again using nested If.
so I do

if (yesCounter > noCounter)
{
if (yesCounter > maybeCounter)
{
Console.WriteLine($"Yes Won");
}
else if (maybeCounter > yesCounter)
{
Console.WriteLine($"Maybe Won");
}
else
{
Console.WriteLine($"DRAW Between Yes and Maybe");
}
}

At this point I resume the video since I think I got the gist of it.
To my surprise you say that after the else there is a draw. (as opposed to just a draw between Yes and Maybe)

I scrub through the rest of the tutorial and I think you do not address my be-puzzlement

So, at the risk of looking like a fool, I present to you with what I think is the code that actually addresses all possible scenarios:

if (yesCounter > noCounter)
{
if (yesCounter > maybeCounter)
{
Console.WriteLine($"Yes Won");
}
else if (maybeCounter > yesCounter)
{
Console.WriteLine($"Maybe Won");
}
else
{
Console.WriteLine($"DRAW Between Yes and Maybe");
}
}
else if (noCounter > yesCounter)
{
if (noCounter > maybeCounter)
{
Console.WriteLine($"No Won");
}
else if (maybeCounter > noCounter)
{
Console.WriteLine($"Maybe Won");
}
else
{
Console.WriteLine($"DRAW Between No and Maybe");
}
}
else if (yesCounter > maybeCounter)
{
Console.WriteLine($"DRAW Between Yes and No");
}
else if (maybeCounter > yesCounter)
{
Console.WriteLine($"Maybe won");
}
else
{
Console.WriteLine($"THREE-WAY DRAW!");
}

Besides this oversight in this tutorial, it is very helpful indeed.
You explain at a good pace, which is excellent because one can just pause and/or rewind the video if something was not clear or moved too fast for them to follow.

I will now continue the video and see what this excess thing is about.
Thanks for making these

edit: So I finished the tutorial and you do acknowledge some different draw conditions, although not all of them. I'm sure you did notice some cases were missing, but decided to leave it as is anyways. Perhaps the "Naive" in the title of the video has got something to do with it also?

Ответить
@ivannavarrovargas3190
@ivannavarrovargas3190 - 26.04.2020 19:07

Thanks for this tutorials, u are so good teaching code.

Ответить
@TakuCoding
@TakuCoding - 20.01.2020 09:26

What about the promised Flutter tutorials?

Ответить