Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma once
- #include "cmath"
- #pragma endregion
- private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) {
- double x,xn,xk,xh;
- Series^ plot1 = chart1->Series[0];
- plot1->Points->Clear();
- if((textBox1->Text!="")&&(textBox2->Text!="")&&(textBox3->Text!=""))
- {
- xn = Convert::ToDouble(textBox1->Text);
- xk = Convert::ToDouble(textBox2->Text);
- xh = Convert::ToDouble(textBox3->Text);
- if ((xn>=xk)||(xh>(xk-xn)))
- {
- MessageBox::Show( "Данные заполнены неверно", "Ошибка ввода данных",MessageBoxButtons::OK,MessageBoxIcon::Exclamation );
- }
- else
- {
- x=xn;
- while (x<=xk)
- {
- plot1->Points->AddXY(x, (pow(x,4)+2*pow(x,3)-x)/pow(cos(x+3),2));
- x=x+xh;
- }
- }
- }
- else
- {
- MessageBox::Show( "Заполните пожалуйста данные", "Ошибка ввода данных",MessageBoxButtons::OK,MessageBoxIcon::Exclamation);
- }
- }
- private: System::Void button2_Click(System::Object^ sender, System::EventArgs^ e) {Application ::Exit();
- }
- };
- }
Advertisement
Add Comment
Please, Sign In to add comment