Senin, 11 Oktober 2010

BAHASA PEMROGRAMAN


Algoritma :                                         
Urutkan Bilangan ganjil dari besar kekecil :  
1.     Tentukan sebuah deret bilangan (mulai dari 1-20)  
2.    Klasifikasikan  antara bil.ganjil dan bil.genap diantara 1-20
3.    Urutkan dari besar kekecil



Algoritma 2 :
Syarat-syarat mengikuti pemilu :
1. Berstatus WNI (Warga Negara Indonesia)
2.  Berumur ≥ 17 tahun
3. Sehat akal (tidak gila)
4. Mempunyai KTP (Kartu Tanda Penduduk)
5. Terdaftar di TPS (Tempat Pemungutan Suara)
6.  Mempunyai Hak Pilih
Pengertian Bahasa Pemrograman
Bahasa pemrograman, atau sering diistilahkan juga dengan bahasa komputer, adalah teknik komando/instruksi standar untuk memerintah komputer. Bahasa pemrograman ini merupakan suatu himpunan dari aturan sintaks dan semantik yang dipakai untuk mendefinisikan program komputer. Bahasa ini memungkinkan seorang programmer dapat menentukan secara persis data mana yang akan diolah oleh komputer, bagaimana data ini akan disimpan/diteruskan, dan jenis langkah apa secara persis yang akan diambil dalam berbagai situasi.
Menurut tingkat kedekatannya dengan mesin komputer, bahasa pemrograman terdiri dari:
1.    Bahasa Mesin, yaitu memberikan perintah kepada komputer dengan memakai kode bahasa biner, contohnya 01100101100110
2.    Bahasa Tingkat Rendah, atau dikenal dengan istilah bahasa rakitan (bah.Inggris Assembly), yaitu memberikan perintah kepada komputer dengan memakai kode-kode singkat (kode mnemonic), contohnya MOV, SUB, CMP, JMP, JGE, JL, LOOP, dsb.
3.    Bahasa Tingkat Menengah, yaitu bahasa komputer yang memakai campuran instruksi dalam kata-kata bahasa manusia (lihat contoh Bahasa Tingkat Tinggi di bawah) dan instruksi yang bersifat simbolik, contohnya {, }, ?, <<, >>, &&, ||, dsb.
4.    Bahasa Tingkat Tinggi, yaitu bahasa komputer yang memakai instruksi berasal dari unsur kata-kata bahasa manusia, contohnya begin, end, if, for, while, and, or, dsb.
Sebagian besar bahasa pemrograman digolongkan sebagai Bahasa Tingkat Tinggi, hanya bahasa C yang digolongkan sebagai Bahasa Tingkat Menengah dan Assembly yang merupakan Bahasa Tingkat Rendah.
Macam-macam Bahasa Pemrograman, yaitu :
1.        Bahasa Pemrograman HTML
HyperText Markup Language (HTML) adalah sebuah bahasa markup yang digunakan untuk membuat sebuah halaman web dan menampilkan berbagai informasi di dalam sebuah browser Internet. HTML saat ini merupakan standar Internet yang didefinisikan dan dikendalikan penggunaannya oleh World Wide Web Consortium (W3C).
HTML berupa kode-kode tag yang menginstruksikan browser untuk menghasilkan tampilan sesuai dengan yang diinginkan. Sebuah file yang merupakan file HTML dapat dibuka dengan menggunakan browser web seperti Mozilla Firefox atau Microsoft Internet Explorer.
2.        Bahasa Pemrograman PHP
PHP adalah bahasa pemrograman script yang paling banyak dipakai saat ini.
PHP pertama kali dibuat oleh Rasmus Lerdorf pada tahun 1995. Pada waktu itu PHP masih bernama FI (Form Interpreted), yang wujudnya berupa sekumpulan script yang digunakan untuk mengolah data form dari web.
PHP banyak dipakai untuk membuat situs web yang dinamis, walaupun tidak tertutup kemungkinan digunakan untuk pemakaian lain. PHP biasanya berjalan pada sistem operasi linux (PHP juga bisa dijalankan dengan hosting windows).
3.        Bahasa Pemrograman ASP
     ASP adalah singkatan dari Active Server Pages yang merupakan salah satu bahasa pemograman web untuk menciptakan halaman web yang dinamis. ASP merupakan salah satu produk teknologi yang disediakan oleh Microsoft. ASP bekerja pada web server dan merupakan server side scripting.
4.         Bahasa Pemrograman XML
     Extensible Markup Language (XML) adalah bahasa markup serbaguna yang direkomendasikan W3C untuk mendeskripsikan berbagai macam data. XML menggunakan markup tags seperti halnya HTML namun penggunaannya tidak terbatas pada tampilan halaman web saja. XML merupakan suatu metode dalam membuat penanda/markup pada sebuah dokumen.
5.        Bahasa Pemrograman WML
WML adalah kepanjangan dari Wireless Markup Language, yaitu bahasa pemrograman yang digunakan dalam aplikasi berbasis XML (eXtensible Markup Langauge). WML ini adalah bahasa pemrograman yang digunakan dalam aplikasi wireless. WML merupakan analogi dari HTML yang berjalan pada protocol nirkabel.
6.        Bahasa Pemrograman PERL
Perl adalah bahasa pemrograman untuk mesin dengan sistem operasi Unix (SunOS, Linux, BSD, HP-UX), juga tersedia untuk sistem operasi seperti DOS, Windows, PowerPC, BeOS, VMS, EBCDIC, dan Pocket PC.
PERL merupakan bahasa pemograman yang mirip bahasa pemograman C.
7.         Bahasa Pemrograman CFM
CFM dibuat menggunakan tag ColdFusion dengan software Adobe ColdFusion / BlueDragon / Coldfusion Studio. Syntax coldfusion berbasis html.
8.        Bahasa Pemrograman Javascript
Javascript adalah bahasa scripting yang handal yang berjalan pada sisi client.
JavaScript merupakan sebuah bahasa scripting yang dikembangkan oleh Netscape.
Untuk menjalankan script yang ditulis dengan JavaScript kita membutuhkan JavaScript-enabled browser yaitu browser yang mampu menjalankan JavaScript.
9.         Bahasa Pemrograman CSS
Cascading Style Sheets (CSS) adalah suatu bahasa stylesheet yang digunakan untuk mengatur tampilan suatu dokumen yang ditulis dalam bahasa markup.
Penggunaan yang paling umum dari CSS adalah untuk memformat halaman web yang ditulis dengan HTML dan XHTML.
Walaupun demikian, bahasanya sendiri dapat dipergunakan untuk semua jenis dokumen XML termasuk SVG dan XUL. Spesifikasi CSS diatur oleh World Wide Web Consortium (W3C).
10.    Bahasa Pemrograman C++
adalah bahasa pemrograman komputer C++ dikembangkan di Bell Labs (Bjarne Stroustrup) pada awal tahun 1970-an, Bahasa itu diturunkan dari bahasa sebelumnya, yaitu BCL, Pada awalnya, bahasa tersebut dirancang sebagai bahasa pemrograman yang dijalankan pada sistem Unix, Pada perkembangannya, versi ANSI (American National Standart Institute) Bahasa pemrograman C menjadi versi dominan, Meskipun versi tersebut sekarang jarang dipakai dalam pengembangan sistem dan jaringan maupun untuk sistem embedded, Bjarne Stroustrup pada Bell labs pertama kali mengembangkan C++ pada awal 1980-an, Untuk mendukung fitur-fitur pada C++, dibangun efisiensi dan sistem support untuk pemrograman tingkat rendah (low level coding). Pada C++ ditambahkan konsep-konsep baru seperti class dengan sifat-sifatnya seperti inheritance dan overloading. Salah satu perbedaan yang paling mendasar dengan bahasa C adalah dukungan terhadap konsep pemrograman berorientasi objek (Object Oriented Programming).[2]
Perbedaan Antara Bahasa pemrograman C dan C++ meskipun bahasa-bahasa tersebut menggunakan sintaks yang sama tetapi mereka memiliki perbedaan, C merupakan bahasa pemrograman prosedural, dimana penyelesaian suatu masalah dilakukan dengan membagi-bagi masalah tersebut kedalam su-submasalah yang lebih kecil, Selain itu, C++ merupakan bahasa pemrograman yang memiliki sifat Pemrograman berorientasi objek, Untuk menyelesaikan masalah, C++ melakukan langkah pertama dengan menjelaskan class-class yang merupakan anak class yang dibuat sebelumnya sebagai abstraksi dari object-object fisik, Class tersebut berisi keadaan object, anggota-anggotanya dan kemampuan dari objectnya, Setelah beberapa Class dibuat kemudian masalah dipecahkan dengan Class. 

       Perbedaan antara Delphi dan Pascal
Delphi Adalah Pascal Tapi Pascal Bukan Delphi
Delphi adalah sebuah bahasa pemrograman yang bersipat Objek (Object Oriented Programming) artinya adalah sebuah program yang mempunyai objek-objek tertentu dalam pemrograman nya. Selain itu Delphi adalah sebuah program yang bersifat visual artinya mempunyai tampilan grafik-grafik yang mudah dimengerti oleh pemula sekalipun (Graphical user Interface). Dengan Delphi Anda bisa membuat program-program dengan tampilan yang menawan, Delphi hanya bisa bekerja di bawah System Microsoft Windows sedangkan untuk system yang lain seperti Linux atau Unix Delphi mempunyai saudara kembarnya yang bisa bekerja pada system tersebut yaitu KYLIX.
Syntax-syntax Delphi di adopsi dari bahasa Pascal, untuk itu di dalam tutorial Dasar-dasar Delphi ini saya akan mengajak Anda ke masa lalu dimana pemrograman komputer saat itu masih menggunakan system 16 BIT yaitu Bahasa PASCAL sebelum Anda dibawa untuk mempelajari Pemrograman Delphi. Bila Anda sudah bisa bahasa PASCAL Anda dapat melewati pengantar mengenai bahasa Pascal ini.
Mengapa saya membawa Anda terlebih dahulu ke Bahasa Pascal tidak langsung ke Delphi?, Dengan mengenal dasar-dasar bahasa pascal, Anda akan mudah untuk mempelajari pemrograman Delphi sebab semua syntax yang ada dalam pascal sama dengan syntax bahasa delphi, tetapi syntax dalam delphi tidak bisa diadopsi ke pascal karena itulah dalam pengantar ini saya beri judul Delphi adalah pascal tapi pascal bukan delphi.
Perbedaan Write dan Writeln
Pernyataan Write digunakan untuk mencetak beberapa buah item ke monitor computer dengan berurutan dan secara otomatis pascal menempatkan kursor ke sebelah kanan kursor terakhir. Rumus umumnya adalah : write (item1, item2, item3….). Item ini dapat berupa angka, karakter, string, nilai Boolean, variable dan ekspresi.
Perintah Writeln merupakan kependekan dari write line, setelah menuliskan parameter/item/string di layar maka kursor penulisan akan langsung pindah ke baris di bawahnya atau ganti baris. Perbedaan write dan writeln adalah setelah menuliskan item-item, pascal memindahkan kursor turun satu baris ke baris berikutnya (menuliskan ke baris yang baru)
Perbedaan Read dan Readln
Pernyataan Read digunakan untuk membaca data yang dimasukkan oleh programmer melalui keyboard. Statemen read tidak memperhatikan batas baris, rinci data (yang tersedia) akan selalu dibaca tidak tergantung apakah mereka ada di baris yang sama atau tidak. Rumus umumnya adalah : read (variabel1, variabel2,….). Pernyataan ini mengharuskan anda memasukkan data melalui keyboard dan mengakhiri proses memasukkan data dengan menekan tombol enter
Pernyataan Readln hampir sama dengan pernyataan read. Pernyataan Readln memindahkan kursor turun satu baris ke baris berikutnya setelah anda mengetikkan nilai variable yang ditanya oleh pascal.
Perbedaanya adalah Kalau pakai read, jika ada perintah "write" lanjutan, perintah itu tidak akan
terbaca Kalau pakai readln, jika ada perintah "write" lanjutan, perintah itu akan dibaca.



Perbedaan read dan redln adalah prosedur readln membaca data sampai ditekan tombol enter. Demikian juga perbedaan write dengan writeln, prosedur writeln akan menempatkan qursor ke baris baru kolom awal.
Perintah read dan readln digunakan untuk meminta masukan dari key board untuk diolah komputer, tipe data yang dicetak dapat berupa integer, real, character, string ataupun boolean, perbedaannya adalah setelah meminta masukan. jika readln akan diakhiri dengan pindah baris, sedangkan pada read tidak. Misalnya read (untuk membaca masukan), readln (membaca masukan termasuk karakter“end of line”), write (untuk mencetak keluaran), writeln (mencetak keluaran dan suatu“end of line”), eof (untuk memeriksan apakah masukan sudah mencapai “end of file”).
ReadLn digunakan untuk memasukkan data perbaris, artinya setelah tombol Enter ditekan, maka akan ganti baris, sedangkan Read tidak ganti baris, masih dalam baris yang sama. Perintah read dan readln akan menangkap masukan yang diberikan melalui keyboard dan menyimpannya disebuah memori computer dengan nama sesuai dengan parameternya. Perbedaan perintah read dan readln sama dengan perbedaan perintah write dan writeln. Perintah read akan membaca masukan dari keyboard tanpa memindahkan posisi kursor setelah pembacaan sedangkan perintah readln akan membaca masukan sekaligus memindahkan posisi kursor.
Algoritma
Rancangan program untuk komputer yang dilaksanakan sebelum program tersebut diolah melalui bahasa pemrograman. Rancangan ini memiliki prosedur yang terstruktur dan mengandung olahan matematika dan logika, terdiri dari rangkaian perintah dan langkah tata cara yang disusun secara teratur.
Algoritma ini diinspirasikan dari hasil pemikiran seorang matematikawan yang bernama Mohammed ibn-Musa Al-Khowarizmi, yang hidup pada tahun 780-850.

Alur logika berpikir manusia yang dituangkan dalam skema tertentu yang selanjutnya dapat diimplementasikan sebagai beberapa perintah dalam suatu bahasa pemrograman untuk menghasilkan sebuah software.
Ciri – ciri dari algoritma seperti yang dipaparkan oleh Donald E. Knuth:
·         Algoritma mempunyai awal dan akhir.
·         Setiap langkah harus didefinisikan dengan tepat sehingga tidak memiliki arti ganda (ambigu).
·         Memiliki masukan (input) atau kondisi awal.
·         Memiliki keluaran (output) atau kondisi akhir.
·         Algoritma harus efektif; bila digunakan benar – benar menyelesaikan persoalan.
Bilangan
Bilangan adalah suatu konsep matematika yang digunakan untuk pencacahan dan pengukuran. Simbol ataupun lambang yang digunakan untuk mewakili suatu bilangan disebut sebagai angka atau lambang bilangan. Dalam matematika, konsep bilangan selama bertahun-tahun lamanya telah diperluas untuk meliputi bilangan nol, bilangan negatif, bilangan rasional, bilangan irasional, dan bilangan kompleks.
Prosedur-prosedur tertentu yang mengambil bilangan sebagai masukan dan menghasil bilangan lainnya sebagai keluran, disebut sebagai operasi numeris. Operasi uner mengambil satu masukan bilangan dan menghasilkan satu keluaran bilangan. Operasi yang lebih umumnya ditemukan adalah operasi biner, yang mengambil dua bilangan sebagai masukan dan menghasilkan satu bilangan sebagai keluaran. Contoh operasi biner adalah penjumlahan, pengurangan, perkalian, pembagian, dan perpangkatan. Bidang matematika yang mengkaji operasi numeris disebut sebagai aritmetika.
Perbedaan Antara Angka dan Bilangan

Sebuah angka digunakan untuk melambangkan bilangan, suatu entitas abstrak dalam ilmu matematika. Tetapi bagi orang-orang awam, angka dan bilangan seringkali dianggap dua entitas yang sama. Mereka pun umumnya menganggap angka dan bilangan sebagai bagian dari matematika.
Memang bahasa Indonesia belum cukup baku sebagai alat komunikasi dalam ilmu dan sains, sehingga belum ada konsesus resmi bahwa ‘angka’ dan ‘bilangan’ melambangkan dua hal yang sangat berbeda. Demikian pula, kedua kata angka dan bilangan masih sering dipertukarkan dengan kata nomor.
Kata nomor biasanya menunjuk satu atau lebih angka yang melambangkan sebuah bilangan bulat dalam suatu barisan bilangan-bilangan bulat yg berurutan. Misalnya kata ‘nomor 3′ menunjuk salah satu posisi urutan dalam barisan bilangan-bilangan 1, 2, 3, 4, …, dst. Jadi kata nomor sangat erat terkait dengan pengertian ‘urutan’.
Arti kata ‘angka’ lebih mendekati arti kata ‘digit’ dalam bahasa Inggris. Nampaknya belum ada kata dalam bahasa Indonesia yang merupakan terjemahan secara tepat dari ‘digit’. Dalam hal ini, sebuah atau beberapa angka lebih berperan sebagai lambang tertulis atau terketik dari sebuah bilangan. Sesuai dengan arti kata ‘digit’, lebih baik pengertian angka dibakukan dengan batasan agar hanya ada sepuluh angka yang berbeda: 0, 1, 2 …, 9.
Untuk memperjelas pengertian angka seperti diuraikan dalam paragraf terakhir, berikut diberikan dua contoh penggunaannya.
“Bilangan sepuluh ditulis dengan dua buah angka (double digits), yaitu angka 1 dan angka 0.”,
“Inflasi di Zinbwabe mencapai 3 angka (three digits)” (Maksudnya, inflasi di Zinbwabe sudah mencapai paling sedikit 100%, sebab bilangan 100 adalah bilangan dengan nilai terendah yang bisa ditulis dengan tiga angka).
Dalam sistem bilangan biner (binary number system), yaitu sistem bilangan basis 2, hanya digunakan dua angka: 0 dan 1, untuk menyatakan sembarang bilangan bulat. Misalnya, deretan tiga angka 101 dalam sistem biner melambangkan bilangan 3 dalam sistem bilangan basis 10.
Tanpa penjelasan lebih jauh, kata ‘bilangan’ di sini selalu diartikan bilangan dalam sistem basis 10.
Deklarasi
Merupakan pembagian dalam sebuah program. Bagian deklarasi digunakan bila didalam program menggunakan pengenal (identifier) yang dapat berupa label, konstanta, tipe, variable, prosedur dan fungsi.
Deklarasi Konstanta
Definisi konstanta diawali dengan kata cadangan Const diikuti oleh kumpulan identifier yang diberi suatu nilai konstanta. Data konstanta nilainya sudah ditentukan dan pasti, tidak dapat dirubah didalam program.
Deklarasi Variabel
Variabel adalah identifier yang berisi data yang dapat diubah-ubah nilainya didalam program. Menggunakan kata cadangan Var sebagai judul didalam bagian deklarasi variable dan diikuti oleh satu atau lebih identifier yang dipisahkan koma, diikuti dengan titik dua dan tipe dari datanya diakhiri dengan titik koma.
Deklarasi Tipe
Pascal menyediakan beberapa macam tipe data, yaitu :
1. tipe data sederhana, terdiri dari :
a. tipe data standar : integer, real, char, string, Boolean
b. Tipe data didefinisikan pemakai : enumerated atau scalar, subrange
2. Tipe data terstruktur : array, record, file, set
3. Tipe data penunjuk
Deklarasi Label
Jika program menggunakan statement Goto untuk meloncat ke suatu statement yang tertentu, maka dibutuhkan suatu label pada statement yang dituju dan label tersebut harus di deklarasikan terlebih dahulu pada bagian deklarasi. Menggunakan kata cadangan Label diikuti oleh kumpulan identifier label dengan dipisahkan oleh koma dan diakhiri dengan titik koma.
Deklarasi Fungsi
Fungsi juga merupakan bagian program yang terpisah mirip dengan prosedur, tetapi ada beberapa perbedaannya. Kata cadangan yang digunakan Function.
Perbedaan antara Run, Compile dan Debug
Run :
Merupakan sebuah aplikasi untuk menjalankan sebuah program setelah program tersebut di check kebenarannya dengan menggunakan debug atau compile.
Compile :
Merupakan sebuah aplikasi untuk mengechek ulang kebenaran suatu program secara langsung (keseluruhan), sehingga sulit untuk menjcari letak kesalahan pada program tersebut.
Debug :
Merupakan aplikasi yang hampir sama dengan compile, yaitu sama-sama berfungsi untuk mengecek ulang kebenaran suatu program, akan tetapi pengecekan tersebut dilakukan secara satu persatu (step by step). Sehingga lebih mudah untuk mengidentifikasi kesalahan yang terjadi pada suatu program.

Delphi Programming
The Delphi programming language is used mostly for the development of desktop and enterprise software. It is a further development of Pascal, and it adds an object-oriented programming extension. Delphi is a high-level programming language, and it can be used for programming Windows applications, including NET applications. Its main functionality is provided by class libraries, although it is possible to use Windows API directly. The Delphi programming language is easy to learn and applications are easy to write. The latest version, Delphi 2009, supports Unicode for an easy internationalization of programs.
Several widely used programs are written in Delphi, such as restaurant pos systems (point-of-sale). This is because the programs are fast and stable, and the database functions are included in Delphi. Basic accounting and inventory features are also easy to implement.
Pascal was designed with the purpose of creating a programming language that is easy to learn and easy to teach. Since Delphi is based on Pascal, the language includes many of the clear and safe features; for example, variables can be declared only at specific positions. One of the biggest advantages of Delphi is the high type safety that shortens the debugging process, since many errors are already found at compile time. Several standards for writing Pascal and Delphi code have been established since the development of the first Pascal version in the 1970s. Everyone who writes in Delphi should stick to these standards since they can help to develop fast programs that are easy to debug. If you want to participate in the huge, worldwide Delphi community, a clear and standard-conform programming style is absolutely necessary.
Visual Basic (VB)
VB is the third-generation event-driven programming language and integrated development environment (IDE) from Microsoft for its COM programming model. VB is also considered a relatively easy to learn and use programming language, because of its graphical development features and BASIC heritage.
Visual Basic was derived from BASIC and enables the rapid application development (RAD) of graphical user interface (GUI) applications, access to databases using Data Access Objects, Remote Data Objects, or ActiveX Data Objects, and creation of ActiveX controls and objects. Scripting languages such as VBA and VBScript are syntactically similar to Visual Basic, but perform differently.
A programmer can put together an application using the components provided with Visual Basic itself. Programs written in Visual Basic can also use the Windows API, but doing so requires external function declarations.The final release was version 6 in 1998. Microsoft's extended support ended in March 2008 and the designated successor was Visual Basic .NET (now known simply as Visual Basic).

Like the BASIC programming language, Visual Basic was designed to be easily learned and used by beginner programmers. The language not only allows programmers to create simple GUI applications, but can also develop complex applications. Programming in VB is a combination of visually arranging components or controls on a form, specifying attributes and actions of those components, and writing additional lines of code for more functionality. Since default attributes and actions are defined for the components, a simple program can be created without the programmer having to write many lines of code. Performance problems were experienced by earlier versions, but with faster computers and native code compilation this has become less of an issue.
Although programs can be compiled into native code executables from version 5 onwards, they still require the presence of runtime libraries of approximately 1 MB in size. This runtime is included by default in Windows 2000 and later, but for earlier versions of Windows like 95/98/NT it must be distributed together with the executable.
Forms are created using drag-and-drop techniques. A tool is used to place controls (e.g., text boxes, buttons, etc.) on the form (window). Controls have attributes and event handlers associated with them. Default values are provided when the control is created, but may be changed by the programmer. Many attribute values can be modified during run time based on user actions or changes in the environment, providing a dynamic application. For example, code can be inserted into the form resize event handler to reposition a control so that it remains centered on the form, expands to fill up the form, etc. By inserting code into the event handler for a keypress in a text box, the program can automatically translate the case of the text being entered, or even prevent certain characters from being inserted.
Visual Basic can create executables (EXE files), ActiveX controls, or DLL files, but is primarily used to develop Windows applications and to interface database systems. Dialog boxes with less functionality can be used to provide pop-up capabilities. Controls provide the basic functionality of the application, while programmers can insert additional logic within the appropriate event handlers. For example, a drop-down combination box will automatically display its list and allow the user to select any element. An event handler is called when an item is selected, which can then execute additional code created by the programmer to perform some action based on which element was selected, such as populating a related list.
Alternatively, a Visual Basic component can have no user interface, and instead provide ActiveX objects to other programs via Component Object Model (COM). This allows for server-side processing or an add-in module.
The language is garbage collected using reference counting, has a large library of utility objects, and has basic object oriented support. Since the more common components are included in the default project template, the programmer seldom needs to specify additional libraries. Unlike many other programming languages, Visual Basic is generally not case sensitive, although it will transform keywords into a standard case configuration and force the case of variable names to conform to the case of the entry within the symbol table. String comparisons are case sensitive by default, but can be made case insensitive if so desired.
The Visual Basic compiler is shared with other Visual Studio languages (C, C++), but restrictions in the IDE do not allow the creation of some targets (Windows model DLLs) and threading models.

Characteristics

Visual Basic has the following traits which differ from C-derived languages:

·       Multiple assignment available in C language is not possible. A = B = C does not imply that the values of A, B and C are equal. The boolean result of "Is B = C?" is stored in A. The result stored in A would therefore be either false or true.
·       Boolean constant True has numeric value −1. This is because the Boolean data type is stored as a 16-bit signed integer. In this construct −1 evaluates to 16 binary 1s (the Boolean value True), and 0 as 16 0s (the Boolean value False). This is apparent when performing a Not operation on a 16 bit signed integer value 0 which will return the integer value −1, in other words True = Not False. This inherent functionality becomes especially useful when performing logical operations on the individual bits of an integer such as And, Or, Xor and Not. This definition of True is also consistent with BASIC since the early 1970s Microsoft BASIC implementation and is also related to the characteristics of CPU instructions at the time.
·      Logical and bitwise operators are unified. This is unlike some C-derived languages (such as Perl), which have separate logical and bitwise operators. This again is a traditional feature of BASIC.
·      Variable array base. Arrays are declared by specifying the upper and lower bounds in a way similar to Pascal and Fortran. It is also possible to use the Option Base statement to set the default lower bound. Use of the Option Base statement can lead to confusion when reading Visual Basic code and is best avoided by always explicitly specifying the lower bound of the array. This lower bound is not limited to 0 or 1, because it can also be set by declaration. In this way, both the lower and upper bounds are programmable. In more subscript-limited languages, the lower bound of the array is not variable. This uncommon trait does exist in Visual Basic .NET but not in VBScript.
    OPTION BASE was introduced by ANSI, with the standard for ANSI Minimal BASIC in the late 1970s.
·      Relatively strong integration with the Windows operating system and the Component Object Model. The native types for strings and arrays are the dedicated COM types, BSTR and SAFEARRAY.
·      Banker's rounding as the default behavior when converting real numbers to integers with the Round function. Round(2.5, 0) gives 2, ? Round(3.5, 0) gives 4.
·      Integers are automatically promoted to reals in expressions involving the normal division operator (/) so that division of one integer by another produces the intuitively correct result. There is a specific integer divide operator (\) which does truncate.
·      By default, if a variable has not been declared or if no type declaration character is specified, the variable is of type Variant. However this can be changed with Deftype statements such as DefInt, DefBool, DefVar, DefObj, DefStr. There are 12 Deftype statements in total offered by Visual Basic 6.0. The default type may be overridden for a specific declaration by using a special suffix character on the variable name (# for Double, ! for Single, & for Long, % for Integer, $ for String, and @ for Currency) or using the key phrase As (type). VB can also be set in a mode that only explicitly declared variables can be used with the command Option Explicit.

 

History

VB 1.0 was introduced in 1991. The drag and drop design for creating the user interface is derived from a prototype form generator developed by Alan Cooper and his company called Tripod. Microsoft contracted with Cooper and his associates to develop Tripod into a programmable form system for Windows 3.0, under the code name Ruby (no relation to the Ruby programming language).
Tripod did not include a programming language at all. Microsoft decided to combine Ruby with the Basic language to create Visual Basic.
The Ruby interface generator provided the "visual" part of Visual Basic and this was combined with the "EB" Embedded BASIC engine designed for Microsoft's abandoned "Omega" database system. Ruby also provided the ability to load dynamic link libraries containing additional controls (then called "gizmos"), which later became the VBX interface.
PASCAL LANGUAGE TUTORIAL
This tutorial teaches the entire Pascal programming language. It is composed of 16 chapters which should be studied in order since topics are introduced in a logical order and build upon topics introduced in previous chapters. This tutorial contains a strong emphasis on object oriented programming and what it will do to improve the quality of your code. It is to the students benefit to download the source code for the example programs, then compile and execute each program as it is studied. The diligent student will modify the example program in some way, then recompile and execute it to see if he understands the material studied for that program. This will provide the student with valuable experience using his compiler.
The recommended method of study is to print the text for one or two chapters, download the example programs, and study the material by loading the example programs in the compiler's editor for viewing. Following successful completion of each chapter, additional chapters can be downloaded as progress is made.
Programming Basics
In a program, you must always obey the rules of the language, in our case, the Pascal language. A natural language has its own grammar rules, spelling and sentence construction. The Pascal programming language is a high level language that has its own syntax rules and grammar rules. As you go along with the lessons, you must note what you can do and what you cannot do in writing a Pascal program.
Inventors Algorithm Concept
The origins of the word algorithm
            The term algorithm, probably not something foreign to us. Friends there who know the meaning of the word 'algorithm'? Judging from the origin of he said, the word 'algorithm' has a rather strange history. People just find a word that means the process of calculating Algorism with Arabic numerals. Someone said 'Algorist' If calculating using Arabic numerals. Linguists attempt to discover the origin of this word but the results are less satisfactory. Finally, historians of mathematics found the origin of the word is derived from the name of the author of the famous Arabic book, namely Abu Abdullah Muhammad Ibn Musa Al-Khuwarizmi read people west into Algorism.

Algorithm Definition
            The definition of algorithm is "logical steps solving problems systematically and logically arranged." A simple example is the preparation of a food recipe, which usually are the steps how to cook these dishes. However, the algorithm is generally used to create a flowchart (flowchart) in computer science / informatics.

The inventor of the concept of algorithm and algebra
The inventor is a mathematician from Uzbekistan named Abu Abdullah Muhammad Ibn Musa al-Khwarizmi. In western literature, he is better known as Algorism. Speed is then used to refer to the concept of an algorithm that finds. Abu Abdullah Muhammad Ibn Musa al-Khwarizmi (770-840) was born in Khwarizm (Kheva), city in the south of the river Oxus (now Uzbekistan) in 770 AD. Both his parents later moved to a place south of Baghdad (Iraq), when he was little. Khwarizm known as the man who introduced the concept of algorithms in mathematics, the concept is taken from a last name.

Al khwarizmi also is the inventor of some branch of mathematics known as an astronomer and geographer. He is one of the greatest mathematical scientists who ever lived, and his writings were very influential in its time. Algebra theory is also the invention and ideas of Al khwarizmi. Name algebra is taken from his famous book titled "Al Jabr wa al Muqabilah". He developed a table that contains details of the trigonometric functions of sine, cosine and kotangen and the concept of differentiation.

His influence in the development of mathematics, astronomy and geography is no doubt in the historical records. The approach he uses a systematic and logical approach. He combines knowledge of Greek Hindu coupled with his very own in developing mathematics. Khwarizm adopted the use of zero, in the science of arithmetic and decimal system. Some of his many translated into Latin in the early 12th century, by two of the leading translators of Bath Adelard and Gerard of Cremona. Aritmetikanya treatises, such as Kitab al-wal-Tafreeq Jam'a Hisab bil al-Hindi, Algebra, Al-Maqala fi Hisab Jabr wa-al-al-Muqabilah, known only from a translation of the Latin language. The books were kept in use until the 16th century as a basic handbook by universities in Europe.

Geography book titled The Book of Surat-al-Ard containing maps of the world has also been translated into English. Fruit Khwarizmi thought in the field of geography is also outstanding. He does not just revise Ptolemy's views on geography, but also fix some parts. Seventy-one geographers have worked under the leadership of Al khwarizmi when making a map of the world's first 830 years. He is reported to have also formed a partnership with the Caliph Mamun al-Rashid when running a project to determine the volume and circumference of the earth.


The Definition of Algorithm
"The algorithm is a sequence of logical steps solving problems systematically and logically arranged." Logical word is the key word in the algorithm. The steps in the algorithm must be logical and must be determined is false or true.

Introduction
All agreed that the computer is a tool to solve the problem. In order for computers to solve problems then necessary to formulate the first steps in a series of instructions. A set of instructions that are solving a problem called "Program".
So that the computer can run the program, it must be written in a language that can be understood by computers. Because the computer is a machine then the program should be written in a language specifically designed to communicate with the computer. Computer language used in writing a program called a programming language. One example of a programming language is the language C. In solving problems with computer assistance, the first step taken is to create a design (design). Design presents ways of thinking programmers in solving problems. This design contains a sequence of steps achieving solutions that are written in descriptive notations. The sequence of systematic steps to solve the problem called ALGORITHM.

Algorithm notation
 Notation notation algorithm is not a programming language, so anyone can make a notation algorithm that berbeda.Hal important about it is easy to read notation and notation dimengerti.Meskipun algorithms are not standard notation but compliance with the notation need to be taken to avoid mistakes.
Several notations in the writing of algorithms:
1.        Notasi I: declare steps algorithm with a string of descriptive phrases.
With the notation style of descriptive phrases, descriptions of each step can be explained by language gamblang.Misalnya, the process begins with a verb such as' read ',' count ',' replace 'and sebagainya.Sedangkan conditional statement expressed by' if ....' , 'Then ....'.
This notation is good for a short algorithm, but for large problems this is not possible dipakai.Selain notation, the conversion of algorithms into a programming language notation tends to be relatively difficult.
2.        Notasi II: using the flow chart (flow-chart).
Flowchart popular in the early era of programming with more flow komputer.Diagram describe the flow of instructions in the program visually shows the structure rather than program.Notasi algorithm is also suitable for small problems, not suitable for large problems because it would require pages and pages of paper to describe the flow program process.
3.        Notation III: using pseudo-code
Pseudocode (pseudo pseudo or no actual meaning) is a notation that resembles a high-level programming language notation such as language C. The results show that programming languages generally have a notation that is almost similar to some instructions, such as notation if-then-else, while-do, repeat-Until, read, write and so forth. Based on these observations, it is defined that the notation algorithm that can explain his orders with a clear language without confusing the reader can be called with the notation algorithm using pseudo-code. Unlike a programming language that bothered by a semicolon and so on, special words, index, format, and others, then the pseudo-code will be more easier and profitable. The advantages of using pseudo-code notation is ease convert kebahasa programming, because there is a correspondence between each pseudo-code with this program.Korespondensi language notation can be realized with table translation of notation algorithm into a program language notations









Tidak ada komentar:

Posting Komentar