Нужно отредактрировать код C#
Помогите, пожалуйста, отредактировать код так, что бы при введении y (yes) или n (no) выбивало "The price suits me", "The price doesn't suit me" и т.д. Просто я новичок
using System;
namespace ConsoleApp5
{
class TV
{
public string model;
public string company;
public string country;
public double price;
public double weight;
public double height;
public double width;
public TV() { }
public TV(string model, string company, string country, double price, double weight, double height, double width)
{
this.model = model;
this.company = company;
this.country = country;
this.price = price;
this.weight = weight;
this.height = height;
this.width = width;
}
}
class Program : ProgramBase1
{
static void Main(string[] args)
{
{
Console.Write("Name of model: ");
string sModel = Console.ReadLine();
Console.Write("Name of Company: ");
string sCompany = Console.ReadLine();
Console.Write("Made in Country: ");
string sCountry = Console.ReadLine();
Console.Write("Price of TV: ");
string sPrice = Console.ReadLine();
Console.Write("Weight of TV: ");
string sWeight = Console.ReadLine();
Console.Write("Height of TV: ");
string sHeight = Console.ReadLine();
Console.Write("The width of TV: ");
string sWidth = Console.ReadLine();
Console.Write("Does the price of the TV suit me? (y-yes, n-no): ");
ConsoleKeyInfo keyprice = Console.ReadKey();
Console.WriteLine();
Console.Write("Does the weight of the TV suit me? (y-yes, n-no): ");
ConsoleKeyInfo keyweight = Console.ReadKey();
Console.WriteLine();
Console.Write("Does the height of the TV suit me? (y-yes, n-no): : ");
ConsoleKeyInfo keyheight = Console.ReadKey();
Console.WriteLine();
Console.Write("Does the width of the TV suit me? (y-yes, n-no): : ");
ConsoleKeyInfo keywidth = Console.ReadKey();
Console.WriteLine();
TV myTV = new TV();
myTV.model = sModel;
myTV.company = sCompany;
myTV.country = sCountry;
myTV.price = keyprice.Key == ConsoleKey.Y ? true : false; ;
myTV.weight = keyweight.Key == ConsoleKey.Y ? true : false; ;
myTV.height = keyheight.Key == ConsoleKey.Y ? true : false;
myTV.width = keywidth.Key == ConsoleKey.Y ? true : false; ;
Console.WriteLine();
Console.WriteLine("_________________________");
Console.WriteLine("Does it match to what you want?");
Console.WriteLine("_________________________");
Console.WriteLine("Model: " + myTV.model);
Console.WriteLine("Company: " + myTV.company);
Console.WriteLine("Country: " + myTV.country);
Console.WriteLine(myTV.price ? "The price suits me" :"The price doesn't suit me");
Console.WriteLine(myTV.weight ? "The weight suits me" :"The weight doesn't suits me");
Console.WriteLine(myTV.width ? "The width suits me" :"The width doesn't suit me");
Console.ReadKey();
}
}
}
}