C
C#13mo ago
נייסוס

❔ help in hw

using System;

public class HelloWorld
{
public static void Main(string[] args)
{
char vote;
int y=0, t=0, n=0, v=0;
Console.WriteLine ("if you want y, if not n, if nutral d");
vote= char.Parse(Console.ReadLine());
while (vote!='f'){
v=v++;
if (vote = 'y')
y=y++;
if (vote = 't')
t=t++;
if (vote = 'n')
n=n++;



vote= char.Parse(Console.ReadLine());
}
if (y/v>0.6)
Console.WriteLine ("הרפורמה תאומץ");
if (t/v>0.6)
Console.WriteLine ("הרפורמה לא תאומץ");

}
}
using System;

public class HelloWorld
{
public static void Main(string[] args)
{
char vote;
int y=0, t=0, n=0, v=0;
Console.WriteLine ("if you want y, if not n, if nutral d");
vote= char.Parse(Console.ReadLine());
while (vote!='f'){
v=v++;
if (vote = 'y')
y=y++;
if (vote = 't')
t=t++;
if (vote = 'n')
n=n++;



vote= char.Parse(Console.ReadLine());
}
if (y/v>0.6)
Console.WriteLine ("הרפורמה תאומץ");
if (t/v>0.6)
Console.WriteLine ("הרפורמה לא תאומץ");

}
}
No description
6 Replies
נייסוס
נייסוסOP13mo ago
error why doesnt this work?
Knuceles
Knuceles13mo ago
vote == Not =
Pobiega
Pobiega13mo ago
please format your code properly, dear god but yeah, knuceles nailed it, = is assigment, not comparison
Angius
Angius13mo ago
$prettycode
MODiX
MODiX13mo ago
To format your code in Visual Studio, Visual Studio Code, Rider, use the following shortcut:
Visual Studio CTRL + K + D
Rider / Resharper CTRL + ALT + L
Visual Studio Code SHIFT + ALT + F
Visual Studio CTRL + K + D
Rider / Resharper CTRL + ALT + L
Visual Studio Code SHIFT + ALT + F
NOTE: the first key must be held while doing it. https://cdn.discordapp.com/attachments/569261465463160900/899513918567890944/2021-10-18_01-26-35.gif
Accord
Accord13mo ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server