Vous êtes sur la page 1sur 23

ESTRUCTURA DE INFORMACION

CURSO:
ESTRUCTURA DE INFORMACION

DOCENTE:
TORALVA GONZALES PAUL

FACULTAD:
INGENIERIA DE SISTEMA CMPUTO Y TELECOMUNICACIONES

INTEGRANTES:
JUNIOR ALEJANDRO HURTADO AVALOS CICLO: IV TURNO: NOCTURNO

2012
ESTRUCTURA DE INFORMACION Pgina 1

ESTRUCTURA DE INFORMACION

EJERCICIOS DESARROLLADOS DE LA PRACTICA N5

ESTRUCTURA DE INFORMACION

Pgina 2

ESTRUCTURA DE INFORMACION
1)
#pragma once namespace ordenamiento { using namespace System; using namespace System::ComponentModel; using namespace System::Collections; using namespace System::Windows::Forms; using namespace System::Data; using namespace System::Drawing; /// <summary> /// Resumen de Form1 /// /// ADVERTENCIA: si cambia el nombre de esta clase, deber cambiar la /// propiedad 'Nombre de archivos de recursos' de la herramienta de compilacin de recursos administrados /// asociada con todos los archivos .resx de los que depende esta clase. De lo contrario, /// los diseadores no podrn interactuar correctamente con los /// recursos adaptados asociados con este formulario. /// </summary> public ref class Form1 : public System::Windows::Forms::Form { public: Form1(void) { InitializeComponent(); // //TODO: agregar cdigo de constructor aqu // } protected: /// <summary> /// Limpiar los recursos que se estn utilizando. /// </summary> ~Form1() { if (components) { delete components; } } private: System::Windows::Forms::Label^ label1; protected: private: System::Windows::Forms::Label^ label2; private: System::Windows::Forms::TextBox^ textBox1; private: System::Windows::Forms::Button^ button1; private: System::Windows::Forms::ListBox^ listBox1; private: System::Windows::Forms::ListBox^ listBox2; private: System::Windows::Forms::Button^ button2; private: System::Windows::Forms::Button^ button3; private: System::Windows::Forms::Button^ button4; private: System::Windows::Forms::Button^ button5;

ESTRUCTURA DE INFORMACION

Pgina 3

ESTRUCTURA DE INFORMACION
private: /// <summary> /// Variable del diseador requerida. static int x=0; static array <int>^ numero=gcnew array<int>(7); /// </summary> System::ComponentModel::Container ^components; #pragma region Windows Form Designer generated code /// <summary> /// Mtodo necesario para admitir el Diseador. No se puede modificar /// el contenido del mtodo con el editor de cdigo. /// </summary> void InitializeComponent(void) { this->label1 = (gcnew System::Windows::Forms::Label()); this->label2 = (gcnew System::Windows::Forms::Label()); this->textBox1 = (gcnew System::Windows::Forms::TextBox()); this->button1 = (gcnew System::Windows::Forms::Button()); this->listBox1 = (gcnew System::Windows::Forms::ListBox()); this->listBox2 = (gcnew System::Windows::Forms::ListBox()); this->button2 = (gcnew System::Windows::Forms::Button()); this->button3 = (gcnew System::Windows::Forms::Button()); this->button4 = (gcnew System::Windows::Forms::Button()); this->button5 = (gcnew System::Windows::Forms::Button()); this->SuspendLayout(); // // label1 // this->label1->AutoSize = true; this->label1->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 12, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point, static_cast<System::Byte>(0))); this->label1->Location = System::Drawing::Point(72, 32); this->label1->Name = L"label1"; this->label1->Size = System::Drawing::Size(308, 20); this->label1->TabIndex = 0; this->label1->Text = L"ORDENAMIENTO DE 7 ELEMENTOS"; // // label2 // this->label2->AutoSize = true; this->label2->Location = System::Drawing::Point(12, 83); this->label2->Name = L"label2"; this->label2->Size = System::Drawing::Size(108, 13); this->label2->TabIndex = 1;

ESTRUCTURA DE INFORMACION

Pgina 4

ESTRUCTURA DE INFORMACION
this->label2->Text = L"INGRESE VALORES"; // // textBox1 // this->textBox1->Location = System::Drawing::Point(140, 83); this->textBox1->Name = L"textBox1"; this->textBox1->Size = System::Drawing::Size(159, 20); this->textBox1->TabIndex = 2; // // button1 // this->button1->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 9.75F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point, static_cast<System::Byte>(0))); this->button1->Location = System::Drawing::Point(318, 83); this->button1->Name = L"button1"; this->button1->Size = System::Drawing::Size(112, 40); this->button1->TabIndex = 3; this->button1->Text = L"INGRESE"; this->button1->UseVisualStyleBackColor = true; this->button1->Click += gcnew System::EventHandler(this, &Form1::button1_Click); // // listBox1 // this->listBox1->FormattingEnabled = true; this->listBox1->Location = System::Drawing::Point(60, 159); this->listBox1->Name = L"listBox1"; this->listBox1->Size = System::Drawing::Size(205, 95); this->listBox1->TabIndex = 4; // // listBox2 // this->listBox2->FormattingEnabled = true; this->listBox2->Location = System::Drawing::Point(60, 280); this->listBox2->Name = L"listBox2"; this->listBox2->Size = System::Drawing::Size(205, 95); this->listBox2->TabIndex = 5; // // button2 // this->button2->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 9.75F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point, static_cast<System::Byte>(0))); this->button2->Location = System::Drawing::Point(309, 181); this->button2->Name = L"button2"; this->button2->Size = System::Drawing::Size(121, 51); this->button2->TabIndex = 6; this->button2->Text = L"MOSTRAR";

ESTRUCTURA DE INFORMACION

Pgina 5

ESTRUCTURA DE INFORMACION
this->button2->UseVisualStyleBackColor = true; this->button2->Click += gcnew System::EventHandler(this, &Form1::button2_Click); // // button3 // this->button3->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 9.75F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point, static_cast<System::Byte>(0))); this->button3->Location = System::Drawing::Point(309, 299); this->button3->Name = L"button3"; this->button3->Size = System::Drawing::Size(121, 58); this->button3->TabIndex = 7; this->button3->Text = L"ORDENAR"; this->button3->UseVisualStyleBackColor = true; this->button3->Click += gcnew System::EventHandler(this, &Form1::button3_Click); // // button4 // this->button4->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 9.75F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point, static_cast<System::Byte>(0))); this->button4->Location = System::Drawing::Point(87, 405); this->button4->Name = L"button4"; this->button4->Size = System::Drawing::Size(115, 51); this->button4->TabIndex = 8; this->button4->Text = L"NUEVO"; this->button4->UseVisualStyleBackColor = true; this->button4->Click += gcnew System::EventHandler(this, &Form1::button4_Click); // // button5 // this->button5->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 9.75F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point, static_cast<System::Byte>(0))); this->button5->Location = System::Drawing::Point(263, 405); this->button5->Name = L"button5"; this->button5->Size = System::Drawing::Size(117, 51); this->button5->TabIndex = 9; this->button5->Text = L"SALIR"; this->button5->UseVisualStyleBackColor = true; this->button5->Click += gcnew System::EventHandler(this, &Form1::button5_Click); // // Form1 // this->AutoScaleDimensions = System::Drawing::SizeF(6, 13); this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;

ESTRUCTURA DE INFORMACION

Pgina 6

ESTRUCTURA DE INFORMACION
this->ClientSize = System::Drawing::Size(463, 491); this->Controls->Add(this->button5); this->Controls->Add(this->button4); this->Controls->Add(this->button3); this->Controls->Add(this->button2); this->Controls->Add(this->listBox2); this->Controls->Add(this->listBox1); this->Controls->Add(this->button1); this->Controls->Add(this->textBox1); this->Controls->Add(this->label2); this->Controls->Add(this->label1); this->Name = L"Form1"; this->Text = L"Form1"; this->Load += gcnew System::EventHandler(this, &Form1::Form1_Load); this->ResumeLayout(false); this->PerformLayout(); } #pragma endregion private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) { numero[x]=Int32::Parse(textBox1->Text); x++; textBox1->Text=""; textBox1->Focus(); if(x==7){ button1->Enabled=false; } } private: System::Void button2_Click(System::Object^ sender, System::EventArgs^ e) { for(int t=0;t<7;t++){ listBox1->Items->Add((t+1)+") "+numero[t]); } } private: System::Void button3_Click(System::Object^ sender, System::EventArgs^ e) { int temp,max=7; for(int i=1;i<max;i++){ for(int j=0;j<max-1;j++){ if(numero[j]<numero[j+1]){ temp=numero[j]; numero[j]=numero[j+1]; numero[j+1]=temp; } } } for(int x=0;x<max;x++){ listBox2->Items->Add((x+1)+") "+numero[x]); } } private: System::Void button4_Click(System::Object^ sender, System::EventArgs^ e) { listBox1->Items->Clear(); listBox2->Items->Clear(); button1->Enabled=true; x=0; } private: System::Void button5_Click(System::Object^ sender, System::EventArgs^ e) {

ESTRUCTURA DE INFORMACION

Pgina 7

ESTRUCTURA DE INFORMACION
Application::Exit(); } private: System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e) { System::Windows::Forms::MessageBox::Show("ORDENAMIENTOMTODO BURBUJA"); } }; }

ESTRUCTURA DE INFORMACION

Pgina 8

ESTRUCTURA DE INFORMACION
2)
#pragma once namespace ordenamiento { using namespace System; using namespace System::ComponentModel; using namespace System::Collections; using namespace System::Windows::Forms; using namespace System::Data; using namespace System::Drawing; /// <summary> /// Resumen de Form1 /// /// ADVERTENCIA: si cambia el nombre de esta clase, deber cambiar la /// propiedad 'Nombre de archivos de recursos' de la herramienta de compilacin de recursos administrados /// asociada con todos los archivos .resx de los que depende esta clase. De lo contrario, /// los diseadores no podrn interactuar correctamente con los /// recursos adaptados asociados con este formulario. /// </summary> public ref class Form1 : public System::Windows::Forms::Form { public: Form1(void) { InitializeComponent(); // //TODO: agregar cdigo de constructor aqu // } protected: /// <summary> /// Limpiar los recursos que se estn utilizando. /// </summary> ~Form1() { if (components) { delete components; } } protected: private: /// <summary> /// Variable del diseador requerida. static int x=0; static array <int>^ numero=gcnew array<int>(5); private: System::Windows::Forms::Label^ label1; private: System::Windows::Forms::Label^ label2; private: System::Windows::Forms::TextBox^ textBox1; private: System::Windows::Forms::Label^ label3; private: System::Windows::Forms::Button^ button1; private: System::Windows::Forms::Button^ button2; private: System::Windows::Forms::ListBox^ listBox1; private: System::Windows::Forms::ListBox^ listBox2; private: System::Windows::Forms::Button^ button3;

ESTRUCTURA DE INFORMACION

Pgina 9

ESTRUCTURA DE INFORMACION
private: System::Windows::Forms::Button^ button4; /// </summary> System::ComponentModel::Container ^components; #pragma region Windows Form Designer generated code /// <summary> /// Mtodo necesario para admitir el Diseador. No se puede modificar /// el contenido del mtodo con el editor de cdigo. /// </summary> void InitializeComponent(void) { this->label1 = (gcnew System::Windows::Forms::Label()); this->label2 = (gcnew System::Windows::Forms::Label()); this->textBox1 = (gcnew System::Windows::Forms::TextBox()); this->label3 = (gcnew System::Windows::Forms::Label()); this->button1 = (gcnew System::Windows::Forms::Button()); this->button2 = (gcnew System::Windows::Forms::Button()); this->listBox1 = (gcnew System::Windows::Forms::ListBox()); this->listBox2 = (gcnew System::Windows::Forms::ListBox()); this->button3 = (gcnew System::Windows::Forms::Button()); this->button4 = (gcnew System::Windows::Forms::Button()); this->SuspendLayout(); // // label1 // this->label1->AutoSize = true; this->label1->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 12, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point, static_cast<System::Byte>(0))); this->label1->Location = System::Drawing::Point(147, 24); this->label1->Name = L"label1"; this->label1->Size = System::Drawing::Size(260, 20); this->label1->TabIndex = 0; this->label1->Text = L"ORDENAMIENTO DE EDADES"; // // label2 // this->label2->AutoSize = true; this->label2->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 8.25F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, static_cast<System::Byte>(0))); this->label2->Location = System::Drawing::Point(12, 92); this->label2->Name = L"label2"; this->label2->Size = System::Drawing::Size(37, 13);

ESTRUCTURA DE INFORMACION

Pgina 10

ESTRUCTURA DE INFORMACION
this->label2->TabIndex = 1; this->label2->Text = L"EDAD"; // // textBox1 // this->textBox1->Location = System::Drawing::Point(55, 89); this->textBox1->Name = L"textBox1"; this->textBox1->Size = System::Drawing::Size(50, 20); this->textBox1->TabIndex = 2; // // label3 // this->label3->AutoSize = true; this->label3->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 8.25F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point, static_cast<System::Byte>(0))); this->label3->Location = System::Drawing::Point(304, 151); this->label3->Name = L"label3"; this->label3->Size = System::Drawing::Size(131, 13); this->label3->TabIndex = 3; this->label3->Text = L"VECTOR ORDENADO"; // // button1 // this->button1->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 9.75F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point, static_cast<System::Byte>(0))); this->button1->Location = System::Drawing::Point(127, 73); this->button1->Name = L"button1"; this->button1->Size = System::Drawing::Size(114, 54); this->button1->TabIndex = 4; this->button1->Text = L"INGRESAR"; this->button1->UseVisualStyleBackColor = true; this->button1->Click += gcnew System::EventHandler(this, &Form1::button1_Click); // // button2 // this->button2->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 9.75F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point, static_cast<System::Byte>(0))); this->button2->Location = System::Drawing::Point(319, 75); this->button2->Name = L"button2"; this->button2->Size = System::Drawing::Size(116, 50); this->button2->TabIndex = 5; this->button2->Text = L"ORDENAR"; this->button2->UseVisualStyleBackColor = true; this->button2->Click += gcnew System::EventHandler(this, &Form1::button2_Click); // // listBox1

ESTRUCTURA DE INFORMACION

Pgina 11

ESTRUCTURA DE INFORMACION
// this->listBox1->FormattingEnabled = true; this->listBox1->Location = System::Drawing::Point(40, 181); this->listBox1->Name = L"listBox1"; this->listBox1->Size = System::Drawing::Size(201, 95); this->listBox1->TabIndex = 6; // // listBox2 // this->listBox2->FormattingEnabled = true; this->listBox2->Location = System::Drawing::Point(277, 181); this->listBox2->Name = L"listBox2"; this->listBox2->Size = System::Drawing::Size(185, 95); this->listBox2->TabIndex = 7; // // button3 // this->button3->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 9.75F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point, static_cast<System::Byte>(0))); this->button3->Location = System::Drawing::Point(127, 303); this->button3->Name = L"button3"; this->button3->Size = System::Drawing::Size(114, 53); this->button3->TabIndex = 8; this->button3->Text = L"NUEVO"; this->button3->UseVisualStyleBackColor = true; this->button3->Click += gcnew System::EventHandler(this, &Form1::button3_Click); // // button4 // this->button4->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 9.75F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point, static_cast<System::Byte>(0))); this->button4->Location = System::Drawing::Point(316, 303); this->button4->Name = L"button4"; this->button4->Size = System::Drawing::Size(119, 53); this->button4->TabIndex = 9; this->button4->Text = L"SALIR"; this->button4->UseVisualStyleBackColor = true; this->button4->Click += gcnew System::EventHandler(this, &Form1::button4_Click); // // Form1 // this->AutoScaleDimensions = System::Drawing::SizeF(6, 13); this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font; this->ClientSize = System::Drawing::Size(523, 395); this->Controls->Add(this->button4);

ESTRUCTURA DE INFORMACION

Pgina 12

ESTRUCTURA DE INFORMACION
this->Controls->Add(this->button3); this->Controls->Add(this->listBox2); this->Controls->Add(this->listBox1); this->Controls->Add(this->button2); this->Controls->Add(this->button1); this->Controls->Add(this->label3); this->Controls->Add(this->textBox1); this->Controls->Add(this->label2); this->Controls->Add(this->label1); this->Name = L"Form1"; this->Text = L"ORDENAMIENTO DE VECTORES"; this->Load += gcnew System::EventHandler(this, &Form1::Form1_Load); this->ResumeLayout(false); this->PerformLayout(); } private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) { numero[x]=Int32::Parse(textBox1->Text); x++; listBox1->Items->Add((x)+") "+textBox1->Text); textBox1->Text=""; textBox1->Focus(); if(x==5){ button1->Enabled=false; } } private: System::Void button2_Click(System::Object^ sender, System::EventArgs^ e) { int temp,max=5,j; for(int i=1;i<max;i++){ temp=numero[i]; for (j=i-1;j>=0 && numero[j]>temp ;j--){ numero[j+1]=numero[j]; } numero[j+1]=temp; } for(int x=0;x<max;x++){ listBox2->Items->Add((x+1)+") "+numero[x]); } } private: System::Void button3_Click(System::Object^ sender, System::EventArgs^ e) { listBox1->Items->Clear(); listBox2->Items->Clear(); button1->Enabled=true; x=0; } private: System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e) { System::Windows::Forms::MessageBox::Show("ORDENAMIENTO-MTODO INSERCIN"); } private: System::Void button4_Click(System::Object^ sender, System::EventArgs^ e) { Application::Exit(); } };

ESTRUCTURA DE INFORMACION

Pgina 13

ESTRUCTURA DE INFORMACION
}

ESTRUCTURA DE INFORMACION

Pgina 14

ESTRUCTURA DE INFORMACION

3)
#pragma once namespace ordenamientodevectores { using namespace System; using namespace System::ComponentModel; using namespace System::Collections; using namespace System::Windows::Forms; using namespace System::Data; using namespace System::Drawing; /// <summary> /// Resumen de Form1 /// /// ADVERTENCIA: si cambia el nombre de esta clase, deber cambiar la /// propiedad 'Nombre de archivos de recursos' de la herramienta de compilacin de recursos administrados /// asociada con todos los archivos .resx de los que depende esta clase. De lo contrario, /// los diseadores no podrn interactuar correctamente con los /// recursos adaptados asociados con este formulario. /// </summary> public ref class Form1 : public System::Windows::Forms::Form { public: Form1(void) { InitializeComponent(); // //TODO: agregar cdigo de constructor aqu // } protected: /// <summary> /// Limpiar los recursos que se estn utilizando. /// </summary> ~Form1() { if (components) { delete components; } } protected: private: /// <summary> /// Variable del diseador requerida. static int x=0; static array <int>^ numero=gcnew array<int>(4); private: System::Windows::Forms::Label^ label1; private: System::Windows::Forms::Label^ label2; private: System::Windows::Forms::Label^ label3; private: System::Windows::Forms::Label^ label4; private: System::Windows::Forms::TextBox^ textBox1; private: System::Windows::Forms::TextBox^ textBox2; private: System::Windows::Forms::TextBox^ textBox3;

ESTRUCTURA DE INFORMACION

Pgina 15

ESTRUCTURA DE INFORMACION
private: private: private: private: private: private: private: private: private: private: private: private: System::Windows::Forms::ListBox^ listBox1; System::Windows::Forms::ListBox^ listBox2; System::Windows::Forms::Button^ button1; System::Windows::Forms::Button^ button2; System::Windows::Forms::Button^ button3; System::Windows::Forms::Button^ button4; System::Windows::Forms::Button^ button5; System::Windows::Forms::Button^ button6; System::Windows::Forms::Button^ button7; System::Windows::Forms::TextBox^ textBox4; System::Windows::Forms::TextBox^ textBox5; System::Windows::Forms::TextBox^ textBox6; /// </summary> System::ComponentModel::Container ^components;

#pragma region Windows Form Designer generated code /// <summary> /// Mtodo necesario para admitir el Diseador. No se puede modificar /// el contenido del mtodo con el editor de cdigo. /// </summary> void InitializeComponent(void) { this->label1 = (gcnew System::Windows::Forms::Label()); this->label2 = (gcnew System::Windows::Forms::Label()); this->label3 = (gcnew System::Windows::Forms::Label()); this->label4 = (gcnew System::Windows::Forms::Label()); this->textBox1 = (gcnew System::Windows::Forms::TextBox()); this->textBox2 = (gcnew System::Windows::Forms::TextBox()); this->textBox3 = (gcnew System::Windows::Forms::TextBox()); this->listBox1 = (gcnew System::Windows::Forms::ListBox()); this->listBox2 = (gcnew System::Windows::Forms::ListBox()); this->button1 = (gcnew System::Windows::Forms::Button()); this->button2 = (gcnew System::Windows::Forms::Button()); this->button3 = (gcnew System::Windows::Forms::Button()); this->button4 = (gcnew System::Windows::Forms::Button()); this->button5 = (gcnew System::Windows::Forms::Button()); this->button6 = (gcnew System::Windows::Forms::Button()); this->button7 = (gcnew System::Windows::Forms::Button()); this->textBox4 = (gcnew System::Windows::Forms::TextBox()); this->textBox5 = (gcnew System::Windows::Forms::TextBox()); this->textBox6 = (gcnew System::Windows::Forms::TextBox());

ESTRUCTURA DE INFORMACION

Pgina 16

ESTRUCTURA DE INFORMACION
this->SuspendLayout(); // // label1 // this->label1->AutoSize = true; this->label1->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 12, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point, static_cast<System::Byte>(0))); this->label1->Location = System::Drawing::Point(222, 23); this->label1->Name = L"label1"; this->label1->Size = System::Drawing::Size(151, 20); this->label1->TabIndex = 0; this->label1->Text = L"ORDENAMIENTO"; // // label2 // this->label2->AutoSize = true; this->label2->Location = System::Drawing::Point(42, 85); this->label2->Name = L"label2"; this->label2->Size = System::Drawing::Size(61, 13); this->label2->TabIndex = 1; this->label2->Text = L"NOMBRES"; // // label3 // this->label3->AutoSize = true; this->label3->Location = System::Drawing::Point(41, 126); this->label3->Name = L"label3"; this->label3->Size = System::Drawing::Size(66, 13); this->label3->TabIndex = 2; this->label3->Text = L"APELLIDOS"; // // label4 // this->label4->AutoSize = true; this->label4->Location = System::Drawing::Point(42, 167); this->label4->Name = L"label4"; this->label4->Size = System::Drawing::Size(44, 13); this->label4->TabIndex = 3; this->label4->Text = L"NOTAS"; // // textBox1 // this->textBox1->Location = System::Drawing::Point(113, 82); this->textBox1->Name = L"textBox1"; this->textBox1->Size = System::Drawing::Size(100, 20); this->textBox1->TabIndex = 4; // // textBox2 // this->textBox2->Location = System::Drawing::Point(113, 126); this->textBox2->Name = L"textBox2";

ESTRUCTURA DE INFORMACION

Pgina 17

ESTRUCTURA DE INFORMACION
this->textBox2->Size = System::Drawing::Size(100, 20); this->textBox2->TabIndex = 5; // // textBox3 // this->textBox3->Location = System::Drawing::Point(113, 167); this->textBox3->Name = L"textBox3"; this->textBox3->Size = System::Drawing::Size(100, 20); this->textBox3->TabIndex = 6; // // listBox1 // this->listBox1->FormattingEnabled = true; this->listBox1->Location = System::Drawing::Point(45, 249); this->listBox1->Name = L"listBox1"; this->listBox1->Size = System::Drawing::Size(120, 121); this->listBox1->TabIndex = 7; // // listBox2 // this->listBox2->FormattingEnabled = true; this->listBox2->Location = System::Drawing::Point(184, 249); this->listBox2->Name = L"listBox2"; this->listBox2->Size = System::Drawing::Size(120, 121); this->listBox2->TabIndex = 8; // // button1 // this->button1->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 9.75F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point, static_cast<System::Byte>(0))); this->button1->Location = System::Drawing::Point(253, 68); this->button1->Name = L"button1"; this->button1->Size = System::Drawing::Size(103, 39); this->button1->TabIndex = 9; this->button1->Text = L"INGRESAR"; this->button1->UseVisualStyleBackColor = true; this->button1->Click += gcnew System::EventHandler(this, &Form1::button1_Click); // // button2 // this->button2->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 9.75F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point, static_cast<System::Byte>(0))); this->button2->Location = System::Drawing::Point(253, 126); this->button2->Name = L"button2"; this->button2->Size = System::Drawing::Size(103, 38);

ESTRUCTURA DE INFORMACION

Pgina 18

ESTRUCTURA DE INFORMACION
this->button2->TabIndex = 10; this->button2->Text = L"NUEVO"; this->button2->UseVisualStyleBackColor = true; this->button2->Click += gcnew System::EventHandler(this, &Form1::button2_Click); // // button3 // this->button3->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 9.75F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point, static_cast<System::Byte>(0))); this->button3->Location = System::Drawing::Point(253, 186); this->button3->Name = L"button3"; this->button3->Size = System::Drawing::Size(103, 38); this->button3->TabIndex = 11; this->button3->Text = L"SALIR"; this->button3->UseVisualStyleBackColor = true; this->button3->Click += gcnew System::EventHandler(this, &Form1::button3_Click); // // button4 // this->button4->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 8.25F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point, static_cast<System::Byte>(0))); this->button4->Location = System::Drawing::Point(338, 249); this->button4->Name = L"button4"; this->button4->Size = System::Drawing::Size(91, 30); this->button4->TabIndex = 12; this->button4->Text = L"ORDENAR"; this->button4->UseVisualStyleBackColor = true; this->button4->Click += gcnew System::EventHandler(this, &Form1::button4_Click); // // button5 // this->button5->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 8.25F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point, static_cast<System::Byte>(0))); this->button5->Location = System::Drawing::Point(338, 295); this->button5->Name = L"button5"; this->button5->Size = System::Drawing::Size(91, 31); this->button5->TabIndex = 13; this->button5->Text = L"PROMEDIO"; this->button5->UseVisualStyleBackColor = true; this->button5->Click += gcnew System::EventHandler(this, &Form1::button5_Click); // // button6 // this->button6->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 8.25F,

ESTRUCTURA DE INFORMACION

Pgina 19

ESTRUCTURA DE INFORMACION
System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point, static_cast<System::Byte>(0))); this->button6->Location = System::Drawing::Point(338, 341); this->button6->Name = L"button6"; this->button6->Size = System::Drawing::Size(91, 33); this->button6->TabIndex = 14; this->button6->Text = L"MAXIMO"; this->button6->UseVisualStyleBackColor = true; this->button6->Click += gcnew System::EventHandler(this, &Form1::button6_Click); // // button7 // this->button7->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 8.25F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point, static_cast<System::Byte>(0))); this->button7->Location = System::Drawing::Point(338, 390); this->button7->Name = L"button7"; this->button7->Size = System::Drawing::Size(91, 35); this->button7->TabIndex = 15; this->button7->Text = L"MINIMO"; this->button7->UseVisualStyleBackColor = true; this->button7->Click += gcnew System::EventHandler(this, &Form1::button7_Click); // // textBox4 // this->textBox4->Location = System::Drawing::Point(439, 301); this->textBox4->Name = L"textBox4"; this->textBox4->Size = System::Drawing::Size(100, 20); this->textBox4->TabIndex = 16; // // textBox5 // this->textBox5->Location = System::Drawing::Point(439, 348); this->textBox5->Name = L"textBox5"; this->textBox5->Size = System::Drawing::Size(100, 20); this->textBox5->TabIndex = 17; // // textBox6 // this->textBox6->Location = System::Drawing::Point(439, 398); this->textBox6->Name = L"textBox6"; this->textBox6->Size = System::Drawing::Size(100, 20); this->textBox6->TabIndex = 18; // // Form1 // this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);

ESTRUCTURA DE INFORMACION

Pgina 20

ESTRUCTURA DE INFORMACION
this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font; this->ClientSize = System::Drawing::Size(573, 461); this->Controls->Add(this->textBox6); this->Controls->Add(this->textBox5); this->Controls->Add(this->textBox4); this->Controls->Add(this->button7); this->Controls->Add(this->button6); this->Controls->Add(this->button5); this->Controls->Add(this->button4); this->Controls->Add(this->button3); this->Controls->Add(this->button2); this->Controls->Add(this->button1); this->Controls->Add(this->listBox2); this->Controls->Add(this->listBox1); this->Controls->Add(this->textBox3); this->Controls->Add(this->textBox2); this->Controls->Add(this->textBox1); this->Controls->Add(this->label4); this->Controls->Add(this->label3); this->Controls->Add(this->label2); this->Controls->Add(this->label1); this->Name = L"Form1"; this->Text = L"ORDENAMIENTO DE VECTORES"; this->Load += gcnew System::EventHandler(this, &Form1::Form1_Load); this->ResumeLayout(false); this->PerformLayout(); } private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) { numero[x]=Int32::Parse(textBox3->Text); x++; listBox1->Items->Add((x)+") "+textBox3->Text); textBox3->Text=""; textBox3->Focus(); if(x==4){ button1->Enabled=false; } } private: System::Void button4_Click(System::Object^ sender, System::EventArgs^ e) { int temp,max=4,j; for(int i=1;i<max;i++){ temp=numero[i]; for (j=i-1;j>=0 && numero[j]>temp ;j--){ numero[j+1]=numero[j]; } numero[j+1]=temp; } for(int x=0;x<max;x++){ listBox2->Items->Add((x+1)+") "+numero[x]); } } private: System::Void button5_Click(System::Object^ sender, System::EventArgs^ e) { int i,s=0,p=0; for(i=0;i<4;i++){

ESTRUCTURA DE INFORMACION

Pgina 21

ESTRUCTURA DE INFORMACION
s+=numero[i]; } p=s/4; textBox4->Text=(""+p); } private: System::Void button2_Click(System::Object^ sender, System::EventArgs^ e) { listBox1->Items->Clear(); listBox2->Items->Clear(); textBox1->Text=""; textBox2->Text=""; textBox3->Text=""; textBox4->Text=""; textBox5->Text=""; textBox6->Text=""; textBox3->Focus(); button1->Enabled=true; x=0; } private: System::Void button6_Click(System::Object^ sender, System::EventArgs^ e) { int maximo=numero[0],i; for(i=0;i<4;i++){ if(numero[i]>maximo){ maximo=numero[i]; } textBox5->Text=(""+maximo); } } private: System::Void button7_Click(System::Object^ sender, System::EventArgs^ e) { int minimo=numero[0],i; for(i=0;i<4;i++){ if(numero[i]<minimo){ minimo=numero[i]; } textBox6->Text=(""+minimo); } } private: System::Void button3_Click(System::Object^ sender, System::EventArgs^ e) { Application::Exit(); } private: System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e) { System::Windows::Forms::MessageBox::Show("ORDENAMIENTO-MTODO INSERCIN"); } }; }

ESTRUCTURA DE INFORMACION

Pgina 22

ESTRUCTURA DE INFORMACION

ESTRUCTURA DE INFORMACION

Pgina 23

Vous aimerez peut-être aussi