Имя "z" отсутствует в текущем контексте. Что дописать ? - C#
Формулировка задачи:
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 WindowsFormsApplication4
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
this.timer1.Start();
double x, z;
double p = 3.14;
x = Convert.ToInt32(textBox1.Text);
z = p * (Math.Pow(x, 2));
}
private void timer1_Tick(object sender, EventArgs e)
{
progressBar1.Increment(10);
if (progressBar1.Value == 100) {
textBox2.Text = Convert.ToString(z);
}
}
}
}Решение задачи: «Имя "z" отсутствует в текущем контексте. Что дописать ?»
textual
Листинг программы
{
public partial class Form1 : Form
{
double x,z;
public Form1()
{