LISTING PROGRAM. // // TODO: Add constructor code after the InitializeComponent()

Similar documents
Blank Form. Industrial Programming. Discussion. First Form Code. Lecture 8: C# GUI Development

Sub To Srt Converter. This is the source code of this program. It is made in C# with.net 2.0.

LISTING PROGRAM. //Find the maximum and minimum values in the array int maxvalue = integers[0]; //start with first element int minvalue = integers[0];

User-Defined Controls

LAMPIRAN A : LISTING PROGRAM

CIS 3260 Sample Final Exam Part II

1. Windows Forms 2. Event-Handling Model 3. Basic Event Handling 4. Control Properties and Layout 5. Labels, TextBoxes and Buttons 6.

this.openfiledialog = new System.Windows.Forms.OpenFileDialog(); this.label4 = new System.Windows.Forms.Label(); this.

Visual Studio Windows Form Application #1 Basic Form Properties

ListBox. Class ListBoxTest. Allows users to add and remove items from ListBox Uses event handlers to add to, remove from, and clear list

Avoiding KeyStrokes in Windows Applications using C#

SMITE API Developer Guide TABLE OF CONTENTS

Classes in C# namespace classtest { public class myclass { public myclass() { } } }

LISTING PROGRAM. a = b; b = c; c = a + b; } fibs.reverse(); for (int i = 0; i < fibs.count; i++) { if (n >= fibs[i]) { n = n - fibs[i];

C# and.net (1) cont d

LISTING PROGRAM. 1. Module SkripsiUmri.py. import sys, operator, codecs, time. class Timer(object): def init (self): self.t1= time.

LISTING PROGRAM. // // TODO: Add constructor code after the InitializeComponent() call. //

LAMPIRAN A LISTING PROGRAM

C# winforms gridview

In order to create your proxy classes, we have provided a WSDL file. This can be located at the following URL:

This is the start of the server code

LISTING PROGRAM. void FilteringToolStripMenuItemClick(object sender, EventAr s e) { Filtering a = new Filtering(); this.hide(); a.

LAMPIRAN A : LISTING PROGRAM

namespace Tst_Form { private: /// <summary> /// Required designer variable. /// </summary> System::ComponentModel::Container ^components;

Nasosoft Barcode for.net

Tutorial 5 Completing the Inventory Application Introducing Programming

Tutorial 6 Enhancing the Inventory Application Introducing Variables, Memory Concepts and Arithmetic

CALCULATOR APPLICATION

Web Services in.net (2)

LISTING PROGRAM. void KOMPRESIToolStripMenuItemClick(object sender, EventArgs e) { Kompresi k = new Kompresi(); k.show(); this.

LISTING PROGRAM. private void filetoolstripmenuitem_click(object sender, EventArgs e) { this.hide(); Form2 fr = new Form2(); fr.

Introduction to.net. Andrew Cumming, SoC. Introduction to.net. Bill Buchanan, SoC. W.Buchanan (1)

UNIT III APPLICATION DEVELOPMENT ON.NET

Classes and Objects. Andrew Cumming, SoC. Introduction to.net. Bill Buchanan, SoC. W.Buchanan (1)

Classes and Objects. Andrew Cumming, SoC. Introduction to.net. Bill Buchanan, SoC. W.Buchanan (1)

LISTING PROGRAM. mainform.vb A-1. Universitas Sumatera Utara

Introduction to.net. Andrew Cumming, SoC. Introduction to.net. Bill Buchanan, SoC. W.Buchanan (1)

A-1 LISTING PROGRAM. 1. Form1.cs. Universitas Sumatera Utara

Convertor Binar -> Zecimal Rosu Alin, Calculatoare, An2 Mod de Functionare: Am creat un program, in Windows Form Application, care converteste un

Lampiran B. Program pengendali

if (say==0) { k.commandtext = "Insert into kullanici(k_adi,sifre) values('" + textbox3.text + "','" + textbox4.text + "')"; k.

عنوان مقاله : خواندن و نوشتن محتوای فایل های Excel بدون استفاده ازAutomation Excel تهیه وتنظیم کننده : مرجع تخصصی برنامه نویسان

Inheriting Windows Forms with Visual C#.NET

ABSTRACT. In Windows Operating system, Registry is core component and it contains

Introduction to.net. Andrew Cumming, SoC. Introduction to.net. Bill Buchanan, SoC. W.Buchanan (1)

% --- Executes on button press in btn_gsn. function btn_gsn_callback(hobject, eventdata, handles) GaussianSpeckleNoise close AiSoftware;

.NET XML Web Services

UNIT-3. Prepared by R.VINODINI 1

LISTING PROGRAM. namespace vigenere_des { public partial class MainPage : PhoneApplicationPage { public MainPage() { InitializeComponent(); }

C# Forms and Events. Evolution of GUIs. Macintosh VT Datavetenskap, Karlstads universitet 1

Object oriented lab /second year / review/lecturer: yasmin maki

LISTING PROGRAM. // // TODO: Add constructor code after the InitializeComponent()

create database ABCD use ABCD create table bolumler ( bolumkodu int primary key, bolumadi varchar(20) )

بسم هللا الرحمن الرحيم المحاضرة السابعة مستوى ثالث علوم حاسوب برمجة مرئية 2 )عملي ) جامعة الجزيرة محافظة اب الجمهورية اليمنية النافذة الرئيسية

Listing Program. private void exittoolstripmenuitem_click(object sender, EventArgs e) { Application.Exit(); }

Towards More Comprehensive Information Retrieval Systems: Entity Extraction Using XSLT

} } public void getir() { DataTable dt = vt.dtgetir("select* from stok order by stokadi");

Operatii pop si push-stiva

Lucrare pentru colocviu de practică

Visual Basic/C# Programming (330)

CHAPTER 3. Writing Windows C# Programs. Objects in C#

Tutorial 19 - Microwave Oven Application Building Your Own Classes and Objects

LISTING PROGRAM. % UIWAIT makes pertama wait for user response (see UIRESUME) % uiwait(handles.figure1);

IBSDK Quick Start Tutorial for C# 2010

CSIS 1624 CLASS TEST 6

Experiment 5 : Creating a Windows application to interface with 7-Segment LED display

LISTING CODE A-1. Indo_to_jawa_Fragments.java. package studio.arti.kamusjawaindonesia;

The Open Core Interface SDK has to be installed on your development computer. The SDK can be downloaded at:

You can call the project anything you like I will be calling this one project slide show.

Listing Progam. Universitas Sumatera Utara

BackgroundWorker Component Overview 1 Multithreading with the BackgroundWorker Component 3 Walkthrough Running an Operation in the Background 10 How

Representing Recursive Relationships Using REP++ TreeView

#pragma comment(lib, "irrklang.lib") #include <windows.h> namespace SuperMetroidCraft {

Mainly three tables namely Teacher, Student and Class for small database of a school. are used. The snapshots of all three tables are shown below.

// Specify SEF file to load. oschema = (edischema) oedidoc.loadschema(spath + sseffilename, SchemaTypeIDConstants. Schema_Standard_Exchange_Format);

Now find the button component in the tool box. [if toolbox isn't present click VIEW on the top and click toolbox]

string spath; string sedifile = "277_005010X228.X12"; string sseffile = "277_005010X228.SemRef.EVAL0.SEF";

pojedinačnom elementu niza se pristupa imeniza[indeks] indeks od 0 do n-1

C:\homeworks\PenAttention_v13_src\PenAttention_v13_src\PenAttention4\PenAttention\PenAttention.cs 1 using System; 2 using System.Diagnostics; 3 using

and event handlers Murach's C# 2012, C6 2013, Mike Murach & Associates, Inc. Slide 1

Team project 2017 Dony Pratidana S. Hum Bima Agus Setyawan S. IIP

Quick Guide for the ServoWorks.NET API 2010/7/13

Answer on Question# Programming, C#

Overview. Building a Web-Enabled Decision Support System. Integrating DSS in Business Curriculum. Introduction to DatabaseSupport Systems

// Specify SEF file to load. edischema oschema = oedidoc.loadschema(spath + sseffilename, SchemaTypeIDConstants. Schema_Standard_Exchange_Format);

Flag Quiz Application

Bachelor s Thesis: Building Web Application for Mahabad University Graduate Affairs Afsaneh Nezami Savojbolaghi

Visual Basic/C# Programming (330)

namespace csharp_gen277x214 { public partial class Form1 : Form { public Form1() { InitializeComponent(); }

XNA 4.0 RPG Tutorials. Part 11b. Game Editors

Conventions in this tutorial

PS2 Random Walk Simulator

First start a new Windows Form Application from C# and name it Interest Calculator. We need 3 text boxes. 4 labels. 1 button

UNIT - III BUILDING WINDOWS APPLICATION GENERAL WINDOWS CONTROLS FOR THE WINDOWS APPLICATION

LISTING PROGRAM. if nargout [varargout{1:nargout}] = gui_mainfcn(gui_state, varargin{:}); else gui_mainfcn(gui_state, varargin{:}); end

Main Game Code. //ok honestly im not sure, if i guess its a class ment for this page called methodtimer that //either uses the timer or set to timer..

Adapting a Grid to REP++

Philadelphia University Faculty of Information Technology. Visual Programming. Using C# -Work Sheets-

Instructions for writing Web Services using Microsoft.NET:

Huw Talliss Data Structures and Variables. Variables

Transcription:

A-1 LISTING PROGRAM Form Mainform /* * Created by SharpDevelop. * User: Roni Anggara * Date: 5/17/2016 * Time: 8:52 PM * * To change this template use Tools Options Coding Edit Standard Headers. */ using System; using System.Collections.Generic; using System.Drawing; using System.Windows.Forms; using MySql.Data.MySqlClient; using System.Data; namespace ronianggara / <summary> / Description of MainForm. / </summary> public partial class MainForm : Form MySqlConnection c = new MySqlConnection("Server=localhost;Database=gym;Uid=root;"); public MainForm() The InitializeComponent() call is required for Windows Forms designer support. InitializeComponent(); call. TODO: Add constructor code after the InitializeComponent() void BAYESToolStripMenuItemClick(object sender, EventArgs e) Form pindah = new ProfileMatching(); pindah.showdialog(); void TOPSISToolStripMenuItemClick(object sender, EventArgs e)

A-2 Form pindah = new TOPSIS(); pindah.showdialog(); void MainFormLoad(object sender, EventArgs e) segar(); public void segar() c.open(); datagridview1.columns.clear(); DataTable dt = new DataTable(); MySqlDataAdapter da = new MySqlDataAdapter("select * from data", c); da.fill(dt); datagridview1.datasource = dt.defaultview; datagridview1.columns[0].width = 50; datagridview1.columns[0].defaultcellstyle.alignment = DataGridViewContentAlignment.MiddleCenter; datagridview1.columns[1].width = 150; datagridview1.columns[1].defaultcellstyle.alignment = DataGridViewContentAlignment.MiddleLeft; datagridview1.columns[2].width = 50; datagridview1.columns[2].defaultcellstyle.alignment = DataGridViewContentAlignment.MiddleCenter; datagridview1.columns[3].width = 40; datagridview1.columns[3].defaultcellstyle.alignment = DataGridViewContentAlignment.MiddleCenter; datagridview1.columns[4].width = 70; datagridview1.columns[4].defaultcellstyle.alignment = DataGridViewContentAlignment.MiddleCenter; datagridview1.columns[5].width = 60; datagridview1.columns[5].defaultcellstyle.alignment = DataGridViewContentAlignment.MiddleCenter; DataGridViewButtonColumn tambah_jumlah = new DataGridViewButtonColumn(); tambah_jumlah.text = "Edit Data"; tambah_jumlah.usecolumntextforbuttonvalue = true; datagridview1.columns.add(tambah_jumlah); DataGridViewButtonColumn tambah_jumlahh = new DataGridViewButtonColumn(); tambah_jumlahh.text = "Delete Data"; tambah_jumlahh.usecolumntextforbuttonvalue = true; datagridview1.columns.add(tambah_jumlahh); c.close(); void MetodeToolStripMenuItemClick(object sender, EventArgs e)

A-3 void Button3Click(object sender, EventArgs e) Form pindah = new editdata(); pindah.showdialog(); void PictureBox1Click(object sender, EventArgs e) void Button1Click(object sender, EventArgs e) Form pindah = new inputdata(); pindah.showdialog(); segar(); void Button2Click(object sender, EventArgs e) Form pindah = new deletedata(); pindah.showdialog(); void PerbandinganToolStripMenuItemClick(object sender, EventArgs e) Form pindah = new Perbandingan(); pindah.showdialog(); void DataGridView1CellContentClick(object sender, DataGridViewCellEve ntargs e) c.open(); int col = e.columnindex, row = e.rowindex; DialogResult dialogresult = MessageBox.Show("Sure", "Some Title", MessageBoxButtons.YesNo); if(col.equals(6)) if(dialogresult == DialogResult.Yes) MySqlCommand cmd = new MySqlCommand("update data set nama_gym ='" + datagridview1[1, row].value.tostring() + "', fasilitas = '" + datagridview1[2, row].value.tostring() + "', harga ='" + datagridview1[3, row].value.tostring() + "', kenyamanan ='" + datagridview1[4, row].value.tostring() + "', keamanan='" + datagridview1[5, row].value.tostring() + "'where no ='"+datagridview1[0, row].value.tostring()+"'", c); cmd.executenonquery(); MessageBox.Show("Data siswa berhasil

diubah","informasi",messageboxbuttons.ok,messageboxicon.information,messagebo xdefaultbutton.button1); else if (dialogresult == DialogResult.No) do something else else if(col.equals(7)) if(dialogresult == DialogResult.Yes) MySqlCommand cmd = new MySqlCommand("delete from data where no ='"+datagridview1[0, row].value.tostring()+"'", c); cmd.executenonquery(); else if (dialogresult == DialogResult.No) do something else c.close(); segar(); A-4 gs e) void MenuStrip1ItemClicked(object sender, ToolStripItemClickedEventAr void ContextMenuStrip1Opening(object sender, System.ComponentModel.Ca nceleventargs e) Form Inputdata /* * Created by SharpDevelop. * User: Roni Anggara * Date: 5/21/2016 * Time: 8:33 PM * * To change this template use Tools Options Coding Edit Standard Headers. */ using System; using System.Collections.Generic; using System.Drawing;

A-5 using System.Windows.Forms; using MySql.Data.MySqlClient; using System.Data; namespace ronianggara / <summary> / Description of inputdata. / </summary> public partial class inputdata : Form MySqlConnection c = new MySqlConnection("Server=localhost;Database=gym;Uid=root;"); public inputdata() The InitializeComponent() call is required for Windows Forms designer support. InitializeComponent(); call. TODO: Add constructor code after the InitializeComponent() void Button1Click(object sender, EventArgs e) if (textbox1.text == "" textbox2.text == "" textbox3.text == "" textbox4.text == "" textbox5.text == "" textbox6.text == "") MessageBox.Show("ada data yang belum terisi"); else c.open(); MySqlCommand cmd = new MySqlCommand("insert into data values('"+textbox1.text+"','" + textbox2.text + "','" + textbox3.text + "','" + textbox4.text + "','" + textbox5.text + "','" + textbox6.text + "')", c); cmd.executenonquery(); MessageBox.Show("data berhasil disimpan"); c.close(); textbox1.text = ""; textbox2.text = ""; textbox3.text = ""; textbox4.text = "";

A-6 Form ProfileMatching /* * Created by SharpDevelop. * User: Roni Anggara * Date: 11/3/2016 * Time: 7:53 PM * * To change this template use Tools Options Coding Edit Standard Headers. */ namespace ronianggara partial class ProfileMatching / <summary> / Designer variable used to keep track of non-visual components. / </summary> private System.ComponentModel.IContainer components = null; / <summary> / Disposes resources used by the form. / </summary> / <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> protected override void Dispose(bool disposing) if (disposing) if (components!= null) components.dispose(); base.dispose(disposing); / <summary> / This method is required for Windows Forms designer support. / Do not change the method contents inside the source code editor. The Forms designer might / not be able to load this method if it was changed manually. / </summary> private void InitializeComponent() this.label1 = new System.Windows.Forms.Label(); this.textbox1 = new System.Windows.Forms.TextBox(); this.label2 = new System.Windows.Forms.Label(); this.label3 = new System.Windows.Forms.Label(); this.label4 = new System.Windows.Forms.Label(); this.textbox2 = new System.Windows.Forms.TextBox(); this.textbox3 = new System.Windows.Forms.TextBox(); this.textbox4 = new System.Windows.Forms.TextBox(); this.label5 = new System.Windows.Forms.Label(); this.label6 = new System.Windows.Forms.Label(); this.textbox5 = new System.Windows.Forms.TextBox(); this.textbox6 = new System.Windows.Forms.TextBox();

this.label7 = new System.Windows.Forms.Label(); this.label8 = new System.Windows.Forms.Label(); this.datagridview1 = new System.Windows.Forms.DataGridView(); this.button1 = new System.Windows.Forms.Button(); this.datagridview2 = new System.Windows.Forms.DataGridView(); ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)). BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.dataGridView2)). BeginInit(); this.suspendlayout(); label1 this.label1.location = new System.Drawing.Point(36, 89); this.label1.name = "label1"; this.label1.size = new System.Drawing.Size(72, 23); this.label1.tabindex = 0; this.label1.text = "fasilitas"; textbox1 this.textbox1.location = new System.Drawing.Point(164, 83); this.textbox1.name = "textbox1"; this.textbox1.size = new System.Drawing.Size(100, 20); this.textbox1.tabindex = 1; this.textbox1.text = "8"; label2 this.label2.location = new System.Drawing.Point(36, 112); this.label2.name = "label2"; this.label2.size = new System.Drawing.Size(72, 23); this.label2.tabindex = 2; this.label2.text = "harga"; label3 this.label3.location = new System.Drawing.Point(36, 135); this.label3.name = "label3"; this.label3.size = new System.Drawing.Size(72, 23); this.label3.tabindex = 3; this.label3.text = "kenyamanan"; label4 this.label4.location = new System.Drawing.Point(36, 158); this.label4.name = "label4"; this.label4.size = new System.Drawing.Size(72, 23); this.label4.tabindex = 4; this.label4.text = "keamanan"; textbox2 this.textbox2.location = new System.Drawing.Point(164, 109); this.textbox2.name = "textbox2"; A-7

A-8 this.textbox2.size = new System.Drawing.Size(100, 20); this.textbox2.tabindex = 5; this.textbox2.text = "7"; textbox3 this.textbox3.location = new System.Drawing.Point(164, 135); this.textbox3.name = "textbox3"; this.textbox3.size = new System.Drawing.Size(100, 20); this.textbox3.tabindex = 6; this.textbox3.text = "7"; textbox4 this.textbox4.location = new System.Drawing.Point(164, 161); this.textbox4.name = "textbox4"; this.textbox4.size = new System.Drawing.Size(100, 20); this.textbox4.tabindex = 7; this.textbox4.text = "6"; label5 this.label5.location = new System.Drawing.Point(36, 267); this.label5.name = "label5"; this.label5.size = new System.Drawing.Size(100, 23); this.label5.tabindex = 8; this.label5.text = "core factor"; label6 this.label6.location = new System.Drawing.Point(36, 304); this.label6.name = "label6"; this.label6.size = new System.Drawing.Size(100, 23); this.label6.tabindex = 9; this.label6.text = "secondary factor"; textbox5 this.textbox5.location = new System.Drawing.Point(164, 270); this.textbox5.name = "textbox5"; this.textbox5.size = new System.Drawing.Size(100, 20); this.textbox5.tabindex = 10; this.textbox5.text = "60"; textbox6 this.textbox6.location = new System.Drawing.Point(164, 307); this.textbox6.name = "textbox6"; this.textbox6.size = new System.Drawing.Size(100, 20); this.textbox6.tabindex = 11; this.textbox6.text = "40"; label7 this.label7.location = new System.Drawing.Point(82, 47);

this.label7.name = "label7"; this.label7.size = new System.Drawing.Size(100, 23); this.label7.tabindex = 12; this.label7.text = "Nilai Ideal"; label8 this.label8.location = new System.Drawing.Point(82, 227); this.label8.name = "label8"; this.label8.size = new System.Drawing.Size(100, 23); this.label8.tabindex = 13; this.label8.text = "Persentase"; datagridview1 this.datagridview1.columnheadersheightsizemode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.datagridview1.location = new System.Drawing.Point(287, 12); this.datagridview1.name = "datagridview1"; this.datagridview1.size = new System.Drawing.Size(439, 198); this.datagridview1.tabindex = 14; button1 this.button1.location = new System.Drawing.Point(426, 244); this.button1.name = "button1"; this.button1.size = new System.Drawing.Size(120, 46); this.button1.tabindex = 15; this.button1.text = "hitung"; this.button1.usevisualstylebackcolor = true; this.button1.click += new System.EventHandler(this.Button1Click); datagridview2 this.datagridview2.allowusertoaddrows = false; this.datagridview2.allowusertodeleterows = false; this.datagridview2.columnheadersheightsizemode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.datagridview2.location = new System.Drawing.Point(12, 12); this.datagridview2.name = "datagridview2"; this.datagridview2.size = new System.Drawing.Size(10, 10); this.datagridview2.tabindex = 16; this.datagridview2.visible = false; ProfileMatching this.autoscaledimensions = new System.Drawing.SizeF(6F, 13F); this.autoscalemode = System.Windows.Forms.AutoScaleMode.Font; this.clientsize = new System.Drawing.Size(754, 336); this.controls.add(this.datagridview2); this.controls.add(this.button1); this.controls.add(this.datagridview1); this.controls.add(this.label8); this.controls.add(this.label7); this.controls.add(this.textbox6); A-9

A-10 this.controls.add(this.textbox5); this.controls.add(this.label6); this.controls.add(this.label5); this.controls.add(this.textbox4); this.controls.add(this.textbox3); this.controls.add(this.textbox2); this.controls.add(this.label4); this.controls.add(this.label3); this.controls.add(this.label2); this.controls.add(this.textbox1); this.controls.add(this.label1); this.name = "ProfileMatching"; this.text = "ProfileMatching"; ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)). EndInit(); ((System.ComponentModel.ISupportInitialize)(this.dataGridView2)). EndInit(); this.resumelayout(false); this.performlayout(); private System.Windows.Forms.DataGridView datagridview2; private System.Windows.Forms.Button button1; private System.Windows.Forms.DataGridView datagridview1; private System.Windows.Forms.Label label8; private System.Windows.Forms.Label label7; private System.Windows.Forms.TextBox textbox6; private System.Windows.Forms.TextBox textbox5; private System.Windows.Forms.Label label6; private System.Windows.Forms.Label label5; private System.Windows.Forms.TextBox textbox4; private System.Windows.Forms.TextBox textbox3; private System.Windows.Forms.TextBox textbox2; private System.Windows.Forms.Label label4; private System.Windows.Forms.Label label3; private System.Windows.Forms.Label label2; private System.Windows.Forms.TextBox textbox1; private System.Windows.Forms.Label label1; Form TOPSIS /* * Created by SharpDevelop. * User: Roni Anggara * Date: 5/19/2016 * Time: 8:52 PM * * To change this template use Tools Options Coding Edit Standard Headers. */ using System;

A-11 using System.Drawing; using System.Windows.Forms; using System.ComponentModel; using System.Data; using MySql.Data.MySqlClient; namespace ronianggara / <summary> / Description of TOPSIS. / </summary> public partial class TOPSIS : Form string[] nama; double[] fasilitas,harga,kenyamanan,keamanan; MySqlConnection c = new MySqlConnection("Server=localhost;Database=gym;Uid=root;"); public TOPSIS() The InitializeComponent() call is required for Windows Forms designer support. InitializeComponent(); call. TODO: Add constructor code after the InitializeComponent() void Button1Click(object sender, EventArgs e) datagridview1.columns.clear(); c.open(); DataTable dt = new DataTable(); MySqlDataAdapter da = new MySqlDataAdapter("select nama_gym,fasilitas,harga,kenyamanan,keamanan from data", c); da.fill(dt); datagridview2.columns.clear(); datagridview2.datasource = dt.defaultview; c.close(); nama = new string[datagridview2.rows.count]; fasilitas = new double[datagridview2.rows.count]; harga = new double[datagridview2.rows.count]; kenyamanan = new double[datagridview2.rows.count]; keamanan = new double[datagridview2.rows.count]; for (int i = 0; i < datagridview2.rows.count; i++) nama[i] = datagridview2[0, i].value.tostring(); fasilitas[i] = Convert.ToDouble(dataGridView2[1, i].value.tostring()); harga[i] = Convert.ToDouble(dataGridView2[2, i].value.tostring()); kenyamanan[i] =

A-12 Convert.ToDouble(dataGridView2[3, i].value.tostring()); keamanan[i] = Convert.ToDouble(dataGridView2[4, i].value.tostring()); membangun matriks double[,] x = new double[nama.length,4]; x[i,0] = fasilitas[i]; x[i,1] = harga[i]; x[i,2] = kenyamanan[i]; x[i,3] = keamanan[i]; normalisasi matriks double[,] r = new double[nama.length,4]; for (int j = 0; j < 4; j++) double sigma=0; sigma = sigma + Math.Pow(x[i,j],2); r[i,j] = Math.Round(x[i,j]/Math.Sqrt(sigma),3); normalisasi bobot double[] bobot = 2,3,2,1; for (int j = 0; j < 4; j++) r[i,j] = Math.Round(r[i,j] * bobot[j],3); v- dan v+ double[] vmin = new double[4], vmax = new double[4]; for (int j = 0; j < 4; j++) vmin[j] = r[0,j]; vmax[j] = r[0,j]; for (int i = 1; i < nama.length; i++) if (vmin[j]>r[i,j]) vmin[j] = r[i,j]; if (vmax[j]<r[i,j]) vmax[j] = r[i,j];

A-13 d- dan d+ double[] dmin = new double[nama.length], dmax = new double[nama.length]; double totaldmax=0, totaldmin=0; for (int j = 0; j < 4; j++) totaldmax = totaldmax + Math.Pow(vmax[j]-r[i,j],2); totaldmin = totaldmin + Math.Pow(r[i,j]-vmin[j],2); dmax[i] = Math.Round(Math.Sqrt(totaldmax),3); dmin[i] = Math.Round(Math.Sqrt(totaldmin),3); RPI double[] rpi = new double[nama.length]; rpi[i] = Math.Round(dmin[i]/(dmax[i]+dmin[i]),3); datagridview1.columncount = 4; datagridview1.columns[0].name = "Nama"; datagridview1.columns[1].name = "d+"; datagridview1.columns[2].name = "d-"; datagridview1.columns[3].name = "RPI"; datagridview1.rows.add(nama[i],dmax[i],dmin[i],rpi[i]); datagridview1.sort(datagridview1.columns[3], ListSortDirection.De scending); Form Perbandingan /* * Created by SharpDevelop. * User: Roni Anggara * Date: 10/20/2016 * Time: 8:38 PM * * To change this template use Tools Options Coding Edit Standard Headers. */ using System; using System.Drawing; using System.Windows.Forms;

A-14 using System.ComponentModel; using System.Data; using System.Diagnostics; using MySql.Data.MySqlClient; namespace ronianggara / <summary> / Description of Perbandingan. / </summary> public partial class Perbandingan : Form string[] nama; double[] fasilitas,harga,kenyamanan,keamanan; MySqlConnection c = new MySqlConnection("Server=localhost;Database=gym;Uid=root;"); public Perbandingan() The InitializeComponent() call is required for Windows Forms designer support. InitializeComponent(); call. TODO: Add constructor code after the InitializeComponent() public double bobota(double n) if (n == 0) return 5; else if(n == 1) return 4.5; else if(n == -1) return 4; else if(n == 2) return 3.5; else if(n == -2) return 3; else if(n == 3) return 2.5; else if(n == -3) return 2; else if(n == 4) return 1.5; else return 1; void Button1Click(object sender, EventArgs e) int banyakdata = Convert.ToInt32(textBox1.Text);

A-15 Stopwatch watch1 = new Stopwatch(); datagridview1.columns.clear(); c.open(); DataTable dt = new DataTable(); MySqlDataAdapter da = new MySqlDataAdapter("select nama_gym,fasilitas,harga,kenyamanan,keamanan from data", c); da.fill(dt); datagridview3.columns.clear(); datagridview3.datasource = dt.defaultview; c.close(); nama = new string[banyakdata]; fasilitas = new double[banyakdata]; harga = new double[banyakdata]; kenyamanan = new double[banyakdata]; keamanan = new double[banyakdata]; for (int i = 0; i < banyakdata; i++) nama[i] = datagridview3[0, i].value.tostring(); fasilitas[i] = Convert.ToDouble(dataGridView3[1, i].value.tostring()); harga[i] = Convert.ToDouble(dataGridView3[2, i].value.tostring()); kenyamanan[i] = Convert.ToDouble(dataGridView3[3, i].value.tostring()); keamanan[i] = Convert.ToDouble(dataGridView3[4, i].value.tostring()); watch1.restart(); datagridview1.columncount = 2; datagridview1.columns[0].name = "Nama"; datagridview1.columns[1].name = "Nilai Akhir"; gap fasilitas[i] = fasilitas[i] - 8; harga[i] = harga[i] - 7; kenyamanan[i] = kenyamanan[i] - 7; keamanan[i] = keamanan[i] - 6; bobot fasilitas[i] = bobota(fasilitas[i]); harga[i] = bobota(harga[i]); kenyamanan[i] = bobota(kenyamanan[i]); keamanan[i] = bobota(keamanan[i]); nilai total double[] na = new double[nama.length], ni = new double[nama.length];

A-16 na[i] = 0.6*fasilitas[i] + 0.4*harga[i]; ni[i] = 0.6*kenyamanan[i] + 0.4*keamanan[i]; nilai akhir double[] nt = new double[nama.length]; nt[i] = 0.6*na[i] + 0.4*ni[i]; datagridview1.rows.add(nama[i],nt[i]); datagridview1.sort(datagridview1.columns[1], ListSortDirection.De scending); watch1.stop(); textbox3.text = Math.Round(Convert.ToDecimal(watch1.Elapsed.TotalMilliseconds),4).ToString(); datagridview2.columns.clear(); nama = new string[banyakdata]; fasilitas = new double[banyakdata]; harga = new double[banyakdata]; kenyamanan = new double[banyakdata]; keamanan = new double[banyakdata]; for (int i = 0; i < banyakdata; i++) nama[i] = datagridview3[0, i].value.tostring(); fasilitas[i] = Convert.ToDouble(dataGridView3[1, i].value.tostring()); harga[i] = Convert.ToDouble(dataGridView3[2, i].value.tostring()); kenyamanan[i] = Convert.ToDouble(dataGridView3[3, i].value.tostring()); keamanan[i] = Convert.ToDouble(dataGridView3[4, i].value.tostring()); watch1.restart(); membangun matriks double[,] x = new double[nama.length,4]; x[i,0] = fasilitas[i]; x[i,1] = harga[i]; x[i,2] = kenyamanan[i]; x[i,3] = keamanan[i]; normalisasi matriks

A-17 double[,] r = new double[nama.length,4]; for (int j = 0; j < 4; j++) double sigma=0; sigma = sigma + Math.Pow(x[i,j],2); r[i,j] = Math.Round(x[i,j]/Math.Sqrt(sigma),3); normalisasi bobot double[] bobot = 2,3,2,1; for (int j = 0; j < 4; j++) r[i,j] = Math.Round(r[i,j] * bobot[j],3); v- dan v+ double[] vmin = new double[4], vmax = new double[4]; for (int j = 0; j < 4; j++) vmin[j] = r[0,j]; vmax[j] = r[0,j]; for (int i = 1; i < nama.length; i++) if (vmin[j]>r[i,j]) vmin[j] = r[i,j]; if (vmax[j]<r[i,j]) vmax[j] = r[i,j]; d- dan d+ double[] dmin = new double[nama.length], dmax = new double[nama.length]; double totaldmax=0, totaldmin=0; for (int j = 0; j < 4; j++) totaldmax = totaldmax + Math.Pow(vmax[j]-r[i,j],2); totaldmin = totaldmin + Math.Pow(r[i,j]-vmin[j],2); dmax[i] = Math.Round(Math.Sqrt(totaldmax),3); dmin[i] = Math.Round(Math.Sqrt(totaldmin),3); RPI

A-18 double[] rpi = new double[nama.length]; rpi[i] = Math.Round(dmin[i]/(dmax[i]+dmin[i]),3); datagridview2.columncount = 2; datagridview2.columns[0].name = "Nama"; datagridview2.columns[1].name = "RPI"; datagridview2.rows.add(nama[i],rpi[i]); datagridview2.sort(datagridview2.columns[1], ListSortDirection.De scending); watch1.stop(); textbox2.text = Math.Round(Convert.ToDecimal(watch1.Elapsed.TotalMilliseconds),4).ToString();

B-1 CURRICULUM VITAE Data Pribadi Nama : Roni Anggara Sipahutar Jenis Kelamin : Laki-laki Tempat,Tanggal Lahir : Medan, 14 September 1993 Kewarganegaraan : Indonesia Agama : Islam Alamat Sekarang : Jl. K.S.Ketaren g.maninjau no.11a Telp/Hp : 082369063906 Email : roni.anggara35@yahoo.com Riwayat Pendidikan 2011 2015 : S1 Ilmu Komputer 2008 2011 : SMA Negeri 7 Medan 2005 2008 : SMP Negri 13 Medan 1999 2005 : SD Swasta Budi Satria Keahlian Bahasa : Indonesia, Inggris Bahasa Pemrograman : C#, Jaringan Database : MySql Pengalaman Organisasi 2010 2011 : Anggota Pramuka SMA N 7 Medan 2011 2013 : UKMI AL-QUARISMI 2012 2015 : Anggota IMILKOM 2014 2015 : Sekretaris Jendral Sapma PP Sub-komisariat FASILKOM-TI Pengalaman Kepanitiaan 2011 : Panitia Dies Natalis Ilmu Komputer ke-10 2012 : Ketua Panitia Acara Ilmu Komputer Goes to School 2013 : Panitia Pelatihan Dasar Organisasi IMILKOM 2012 2013 : Anggota HUMAS Porseni IMILKOM 2013 : Koordinator Dana PMB Ilmu Komputer USU 2013 : Koordinator Keamanan PMB Fakultas FASILKOM-TI USU 2013 : Panitia Pemilihan Umum Ketua IMILKOM 2014 : Koordinator Keamanan PMB Fakultas FASILKOM-TI USU 2014 : Panitia SENARAI 2014