Can someone check this for me im coding in c# trying to get this converter to take a radius entered into text box 1 and place the volume in text box two please help


#1


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Week_6
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
    private void btnConvert_Click(object sender, EventArgs e)
        {
            double dblradius;
            double dblvolume;

            dblradius = double.Parse(txtRadius.Text);

            dblvolume = 4 / 3 * Math.PI * Math.Pow(dblradius, 3);

            txtVolume.Text = dblvolume.ToString();
        }

        private void btnConvert_Click_1(object sender, EventArgs e)
        {
            double dblradius;
            double dblvolume;

            dblradius = double.Parse(txtRadius.Text);

            dblvolume = 4 / 3 * Math.PI * Math.Pow(dblradius, 3);

            txtVolume.Text = dblvolume.ToString();
        }
    }
}


#2

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.