Answer the question
In order to leave comments, you need to log in
Yes, what's the problem?
I can't already. Some advise to learn from mistakes, others - to read books, the third - to watch videos. Decided to start in chronological order. Now explain to me why it doesn't work?
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Text
{
class Program
{
static void Main(string[] args)
{
bool IsFilm = true;
while (IsFilm)
{
Console.WriteLine("Введите название фильма");
string FilmName = Console.ReadLine();
if (String.IsNullOrWhiteSpace(Isfilm))
{
Console.WriteLine("Вы должны ввести название!");
}
else
{
Console.WriteLine("Название фильма - " + FilmName + " вы согласны его оставить?True/False?");
string IsFilm1 = Console.ReadLine();
if (IsFilm1 = true)
{
IsFilm = False;
}
else
{
IsFilm=true;
}
}
}
Console.WriteLine("Фильм" + FilmName);
}
}
}
Answer the question
In order to leave comments, you need to log in
Try removing the tmp directory. If that doesn't work, remove node_modules and bower and reinstall everything. If that doesn't work, remove bower from the project and move all dependencies to package.json
You are reading the string: string IsFilm1 = Console.ReadLine;
, and comparing it with the boolean type , and besides, you are comparing it incorrectly, you need to write .
In your case, you need to correct for - i.e. comparing string with string. if (IsFilm1 = true)
==
IsFilm1 == "true"
Install ReSharper already and read/correct all its warnings.
Then start FxCop and do the same.
You can do it in any order.
I made a small example of how to better format the code and name variables:
Example
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question