0% found this document useful (0 votes)
23 views2 pages

Using Using Using Using Using Using Using Using Using Namespace Public Partial Class Int Double Double Public

This document contains C# code that defines a Windows Forms application with three radio buttons and two text boxes. When the button is clicked, it checks which radio button is selected and calculates and displays the area of either a rectangle, circle, or sphere based on the values in the text boxes, using different area formulas for each shape.

Uploaded by

Jordan Cajas
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views2 pages

Using Using Using Using Using Using Using Using Using Namespace Public Partial Class Int Double Double Public

This document contains C# code that defines a Windows Forms application with three radio buttons and two text boxes. When the button is clicked, it checks which radio button is selected and calculates and displays the area of either a rectangle, circle, or sphere based on the values in the text boxes, using different area formulas for each shape.

Uploaded by

Jordan Cajas
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

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 Areas
{
public partial class Form1 : Form
{
int b = 0;

double d = 1.33;
double π = 3.1416;
public Form1()
{
InitializeComponent();
}

private void label1_Click(object sender, EventArgs e)


{

private void button1_Click(object sender, EventArgs e)


{
b = Convert.ToInt32 (textBox1.Text );
if (radioButton1.Checked == true) label3.Text = Convert.ToString(b
*Convert.ToInt32 (textBox2.Text) / 2);
if (radioButton2.Checked == true) label3.Text = Convert.ToString(π *
Convert.ToInt32(textBox1.Text)* Convert.ToInt32(textBox1.Text));
if (radioButton3.Checked == true) label3.Text = Convert.ToString(d *π
* Convert.ToInt32(textBox1.Text) * Convert.ToInt32(textBox1.Text) *
Convert.ToInt32(textBox1.Text));

}
}
}

You might also like