xodus8
October 19th, 2008, 12:28 PM
Hello, I am doing an assignment, I need to get a program that figures out slope. I am almost done, I am having writing the last part. I need to divide the numerator by the denominator. I have copied the code below. Thanks
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
int y1, y2, numerator;
int x1, x2, denominator;
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
y2 = int.Parse(textBox1.Text);
y1 = int.Parse(textBox2.Text);
numerator = y2 - y1;
textBox3.Text = numerator.ToString();
}
private void button2_Click(object sender, EventArgs e)
{
x2 = int.Parse(textBox4.Text);
x1 = int.Parse(textBox5.Text);
denominator = x2 - x1;
textBox6.Text = denominator.ToString();
}
private void button3_Click(object sender, EventArgs e)
{
textBox7.Text = textBox3.Text / textBox6.Text.ToString();
}
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
int y1, y2, numerator;
int x1, x2, denominator;
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
y2 = int.Parse(textBox1.Text);
y1 = int.Parse(textBox2.Text);
numerator = y2 - y1;
textBox3.Text = numerator.ToString();
}
private void button2_Click(object sender, EventArgs e)
{
x2 = int.Parse(textBox4.Text);
x1 = int.Parse(textBox5.Text);
denominator = x2 - x1;
textBox6.Text = denominator.ToString();
}
private void button3_Click(object sender, EventArgs e)
{
textBox7.Text = textBox3.Text / textBox6.Text.ToString();
}
}
}