Говорит и пишет на экономическом языке. Да здравствует
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace WindowsFormsApp2
{
public partial class Form1: Form
{
public Form1()
{
InitializeComponent();
}
private void label2_Click(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
int price = 0;
if (comboBox2.Text == "92")
{
price = 70;
} else if (comboBox2.Text == "95")
{
price = 73;
} else if (comboBox2.Text == "ДТ")
{
price = 80;
} else
{
label3.Text = "Выберите тип полива";
return;
}
double money;
double.TryParse(textBox1.Text, out money);
if (money <= 0)
{
label3.Text = "У вас недостаточно денег";
return;
}
double litters = money / price;
double change = money % price;
label3.Text = $"Вы получите {litters:F2} литров и {change:F2} сдачей";
}
private void textBox1_TextChanged(object sender, EventArgs e)
{
}
private void label3_Click(object sender, EventArgs e)
{
}
}
}