• 20-02-2024, 16:36:49
    #1
    Kimlik doğrulama veya yönetimden onay bekliyor.
    Herkese Merhaba;

    C# da bir koda ihtiyacım var fakat bı türlü beceremedim.

    Shift tan ((-880) ÷ ( 2850)) = 17,159

    Normal hesap makinesinde bu sonucu alabiliyorum ve işimi cozebiliyorum.

    Yukarıda belirttiğim işlemi c# yapmak istiyorum. 880 ve 2850 değeri 2 adet textbox dan çekecek. Yani degisebilir. ama gereken işlem yukarıda ki gibi yardımcı olabilecek varsa çok sevinirim.
  • 20-02-2024, 16:45:18
    #2
    using System;
    using System.Windows.Forms;

    namespace CalculatorApp
    {
    public partial class Form1 : Form
    {
    public Form1()
    {
    InitializeComponent();
    }

    private void button1_Click(object sender, EventArgs e)
    {
    // TextBox'tan verileri çek
    double num1 = Convert.ToDouble(textBox1.Text);
    double num2 = Convert.ToDouble(textBox2.Text);

    // İşlemi gerçekleştir
    double result = Math.Atan2(-num1 / num2, 1) * (180 / Math.PI);

    // Sonucu Label'a yazdır
    label1.Text = "Sonuç: " + result.ToString();
    }
    }
    }

    Dener misiniz? (ChatGPT)
  • 20-02-2024, 16:46:50
    #3
    using System;
    using System.Windows.Forms;

    namespace ShiftTanCalculator
    {
    public partial class Form1 : Form
    {
    public Form1()
    {
    InitializeComponent();
    }

    private void calculateButton_Click(object sender, EventArgs e)
    {
    // TextBox'lardan değerleri al
    double pay, payda;

    if (!double.TryParse(textBoxPay.Text, out pay) || !double.TryParse(textBoxPayda.Text, out payda))
    {
    MessageBox.Show("Lütfen geçerli sayısal değerler girin.", "Hata", MessageBoxButtons.OK, MessageBoxIcon.Error);
    return;
    }

    // Hesaplama yap
    double result = Math.Atan(pay / payda) * (180.0 / Math.PI);

    // Sonucu yazdır
    MessageBox.Show("Shift tan ((" + pay + ") ÷ (" + payda + ")) = " + result, "Sonuç", MessageBoxButtons.OK, MessageBoxIcon.Information);
    }
    }
    }


    ChatGPT kullanarak yapabilirsiniz.