This is default featured post 1 title
Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.
This is default featured post 2 title
Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.
This is default featured post 3 title
Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.
This is default featured post 4 title
Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.
This is default featured post 5 title
Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.
Friday, June 17, 2011
Sunday, March 6, 2011
SELISIH WAKTU
using System;
namespace Selisilh_waktu_0320100017
{
class Class1
{
public struct jam
{
public int hh;
public int mm;
public int ss;
}
static void Main(string[] args)
{
jam w1;
jam w2;
jam w3;
Console.Write("Jam awal percakapan : ");
w1.hh = Convert.ToInt32(Console.ReadLine());
Console.Write("Menit awal percakapan : ");
w1.mm = Convert.ToInt32(Console.ReadLine());
Console.Write("Detik awal percakapan : ");
w1.ss = Convert.ToInt32(Console.ReadLine());
Console.Write("Jam akhir percakapan : ");
w2.hh = Convert.ToInt32(Console.ReadLine());
Console.Write("Menit akhir percakapan : ");
w2.mm = Convert.ToInt32(Console.ReadLine());
Console.Write("Detik awal percakapan : ");
w2.ss = Convert.ToInt32(Console.ReadLine());
w3.mm = 0;
w3.ss = 0;
if(w2.ss>=w1.ss)
{
w3.ss=w2.ss-w1.ss;
if(w2.mm>=w1.mm)
{
w3.mm=w2.mm-w1.mm;
w3.hh=w2.hh-w1.hh;
Console.WriteLine("{0},{1},{2}",w3.hh,w3.mm,w3.ss);
}
if(w2.mm<w1.mm)
{
w3.mm=(w2.mm+60)-w1.mm;
w2.hh=w2.hh-1;
w3.hh=w2.hh-w1.hh;
Console.WriteLine("{0},{1},{2}",w3.hh,w3.mm,w3.ss);
}
}
if(w2.ss<w1.ss)
{
w3.ss=(w2.ss+60)-w1.ss;
w2.mm=w2.mm-1;
if(w2.mm>=w1.mm)
{
w3.mm=w2.mm-w1.mm;
w3.hh=w2.hh-w1.hh;
Console.WriteLine("{0},{1},{2}",w3.hh,w3.mm,w3.ss);
}
if(w2.mm<w1.mm)
{
w3.mm=(w2.mm+60)-w1.mm;
w2.hh=w2.hh-1;
w3.hh=w2.hh-w1.hh;
Console.WriteLine("{0},{1},{2}",w3.hh,w3.mm,w3.ss);
}
}
Console.ReadLine();
}
}
}
FAKTORIAL
using System;
namespace Faktorial_017
{
class Class1
{
[STAThread]
static void Main(string[] args)
{
int n, fak, k,i,l;
Console.Write("Masukkan Bilangan : ");
n=Convert.ToInt32(Console.ReadLine());
if(n==0)
{
Console.WriteLine("Faktorial : 1");
Console.ReadLine();
}
else
{
fak=1;
for(i=n;i>=1;i--)
{
l=fak*i;
fak=l;
}
Console.WriteLine("Nilai faktorial adalah : {0}",fak);
Console.ReadLine();
}
}
}
}
BILANGAN TERBESAR
using System;
namespace Perbandingan_Angka_017
{
class Class1
{
[STAThread]
static void Main(string[] args)
{
int a,b,c;
Console.Write("A=? ");
a=Convert.ToInt32(Console.ReadLine());
Console.Write("B=? ");
b=Convert.ToInt32(Console.ReadLine());
Console.Write("C=? ");
c=Convert.ToInt32(Console.ReadLine());
if(a>b)
{
if(a>c)
{
Console.WriteLine("Bilangan terbesar adalah {0}",a);
}
}
if(c>b)
{
if(c>a)
{
Console.WriteLine("Bilangan terbesar adalah {0}",c);
}
}
if(b>a)
{
if(b>c)
{
Console.WriteLine("Bilangan terbesar adalah {0}",b);
}
}
if(a==b && a==c)
{
Console.WriteLine("Semua bilangan sama besar");
}
if(a==b && a>c)
{
Console.WriteLine("Bilangan terbesar ada dua dg angka {0}",a);
}
if(b==c && b>a)
{
Console.WriteLine("Bilangan terbesar ada dua dg angka {0}",b);
}
if(a==c && a>b)
{
Console.WriteLine("Bilangan terbesar ada dua dg angka {0}",a);
}
Console.ReadLine();
}
}
}
KALKULATOR
using System;
namespace ConsoleApplication1
{
class Class1
{
[STAThread]
static void Main(string[] args)
{
double a,b,d;
string c;
try
{
Console.Write("Angka 1 : ");
a=Convert.ToInt32(Console.ReadLine());
Console.Write("+, -,* ,/ : ");
c=Convert.ToString(Console.ReadLine());
Console.Write("Angka 2 : ");
b=Convert.ToInt32(Console.ReadLine());
switch(c)
{
case "+" : d=a+b;
Console.WriteLine("Hasilnya adalah : {0}",d);
Console.ReadLine();
break;
case "-" : d=a-b;
Console.WriteLine("Hasilnya adalah : {0}",d);
Console.ReadLine();
break;
case "*" : d=a*b;
Console.WriteLine("Hasilnya adalah : {0}",d);
Console.ReadLine();
break;
case "/" : d=a/b;
Console.WriteLine("Hasilnya adalah : {0}",d);
Console.ReadLine();
break;
default :Console.WriteLine("Tanda yang anda masukkan salah");
break;
}
}
catch
{
Console.WriteLine("Maaf Inputan Anda salah, silahkan coba lagi");
Console.ReadLine();
}
}
}
}
Saturday, March 5, 2011
HELLO WORLD
using System;
namespace hello_world_0320100017
{
class Class1
{
[STAThread]
static void Main(string[] args)
{
Console.WriteLine("Hello world");//tampilan
Console.ReadLine();
}
}
}
VARIABEL, KONSTANTA dan TIPE DATA
using System;
namespace varkonsttipedata
{
class latihan2
{
[STAThread]
static void Main(string[] args)
{
int x,y,z;//tipe data integer dg variabel x,y,z
y=2;//konstanta dari variabel y adalah 2
Console.WriteLine("\t\tKONSTANTA, VARIABEL dan TIPE DATA");
Console.WriteLine("Masukkan angka : ");
x=Convert.ToInt32(Console.ReadLine());
z=x % y;
if(z==0)
{
Console.WriteLine("Bilangan {0} adalah bilangan genap",x);
Console.ReadLine();
}
else
{
Console.WriteLine("Bilangan {0} adalah bilangan ganjil",x);
Console.ReadLine();
}
}
}
}
OPERATOR
using System;
namespace aku
{
class Class1
{
[STAThread]
static void Main(string[] args)
{
int x,y,z;
Console.WriteLine("\t\t\t\tOPERATOR\n");
Console.Write("\t\tbilangan pertama : ");
x=Convert.ToInt32(Console.ReadLine());
Console.Write("\t\tbilangan kedua : ");
y=Convert.ToInt32(Console.ReadLine());
z=x+y;
Console.WriteLine("\t\tHasil penjumlahan adalah : {0}",z);
Console.ReadLine();
}
}
}
IF
using System;
namespace ConsoleApplication1
{
class coba
{
[STAThread]
static void Main(string[] args)
{
int a,b;
Console.WriteLine("\t\t\t\tif");
Console.WriteLine("\t\t==============================");
Console.Write("Masukkan bilangan pertama : ");
a = Convert.ToInt32(Console.ReadLine());
Console.Write("Masukkan bilangan kedua : ");
b = Convert.ToInt32(Console.ReadLine());
if(a>b)//if syarat
{
Console.WriteLine("\nBilangan terbesar adalah : {0}",a);
Console.ReadLine();
}
if(a<b)//if syarat
{
Console.WriteLine("\nBilangan terbesar adalah : {0}",b);
Console.ReadLine();
}
}
}
}
LOOP
using System;
namespace loop
{
class loop
{
[STAThread]
static void Main(string[] args)
{
int a,b,i;
string c,d,z;
Console.WriteLine("\t\t\t\t LOOP");
Console.WriteLine("\t\t\t\t==============\n\n");
Console.WriteLine("\t\t\t\tData Mahasiswa");
Console.WriteLine("\t\t\t\t==============");
Console.Write("\tMasukkan jumlah Mahasiswa yg akan di input datanya : ");
a=Convert.ToInt32(Console.ReadLine());
do//pengulangan apabila while memenuhi syarat
{
for (i=1;i<=a;i++)//loop pake for
{
Console.WriteLine("\n");
Console.WriteLine("\t\t\tData Mahasiswa ke {0}",i);
for(b=1;b<=i;b++);
{
Console.Write("\t\t\tNama Mahasiswa : ");
c=Console.ReadLine();
Console.WriteLine("\t\t\tNama Mahasiswa adalah {0}",c);
Console.Write("\t\t\tTtl : ");
d=Console.ReadLine();
Console.WriteLine("\t\t\tTanggal Lahirnya {0}",d);
}
}
Console.WriteLine("\t\t\tApakah Anda ingin mengulang
z=Console.ReadLine();
}
while (z=="y"||z=="Y");
Console.WriteLine("\t\t\tThank u for using this program");
Console.ReadLine();
}
}
}
ARRAY
MEMBACA dan MENULIS ke LAYAR
using System;
namespace membaca_n_menulis_ke_layar_0320100017
{
class Class1
{
[STAThread]
static void Main(string[] args)
{
string a,b,c,d,e,f;
Console.WriteLine("\t\t*****My Biodata*****");
Console.WriteLine("\t\t====================");
Console.Write("Nama Anda : ");
a=Convert.ToString(Console.ReadLine());
Console.Write("TTL : ");
b=Convert.ToString(Console.ReadLine());
Console.Write("Alamat : ");
c=Convert.ToString(Console.ReadLine());
Console.Write("Agama : ");
d=Convert.ToString(Console.ReadLine());
Console.Write("Hobby : ");
e=Convert.ToString(Console.ReadLine());
Console.Write("Prinsip hidup : ");
f=Convert.ToString(Console.ReadLine());
Console.WriteLine("===============================================");
Console.WriteLine("\t\t*****My Biodata*****");
Console.WriteLine("Nama saya adalah {0}",a);
Console.WriteLine(". Saya lahir di {0}",b);//menampilkan ke layar
Console.Write("Saya tinggal di {0}",c);//menampilkan ke layar
Console.Write(". Saya beragama {0}",d);//menampilkan ke layar
Console.WriteLine(" dan Hobby saya {0}",e);//menampilkan ke layar
Console.WriteLine("Yang terpenting adalah prinsip hidupku {0}",f);//menampilkan ke layar
Console.ReadLine();
}
}
}
EXCEPTION HANDLING
Program aplikasi C# untuk mengontrol kesalahan apabila user salah menginput. Secara otomatis akan menampilkan pesan eror.
using System;
namespace Exception_Handling
{
class latihan8
{
[STAThread]
static void Main(string[] args)
{
double a,b,d;
string c;
try
{
Console.Write("Angka 1 : ");
a=Convert.ToInt32(Console.ReadLine());
Console.Write("+, -,* ,/ : ");
c=Convert.ToString(Console.ReadLine());
Console.Write("Angka 2 : ");
b=Convert.ToInt32(Console.ReadLine());
switch(c)
{
case "+" : d=a+b;
Console.WriteLine("Hasilnya adalah : {0}",d);
Console.ReadLine();
break;
case "-" : d=a-b;
Console.WriteLine("Hasilnya adalah : {0}",d);
Console.ReadLine();
break;
case "*" : d=a*b;
Console.WriteLine("Hasilnya adalah : {0}",d);
Console.ReadLine();
break;
case "/" : d=a/b;
Console.WriteLine("Hasilnya adalah : {0}",d);
Console.ReadLine();
break;
default :Console.WriteLine("Tanda yang anda masukkan salah");
break;
}
}
catch//menangani apabila inputan salah
{
Console.WriteLine("Maaf Inputan Anda salah, silahkan coba lagi");
Console.ReadLine();
}
}
}
}
Wednesday, January 26, 2011
Cara instalasi windows 7 dan PC Linux dalam satu komputer
6. Pilih don’t get the latest updates for installation ( jika tidak ingin update di internet).
11. Pilih ok.
13. Tunggu proses installing windows. Dalam proses ini, computer akan beberapa kali melakukan restart. Biarkan dan tunggu sampai completing installation. Proses memakan waktu sekitar 30 menit.
14. Akan muncul tampilan di bawah ini. Isikan username computer sesuai keinginan
15. Masukkan password yang kita inginkan, Masukkan password hint sebagai password petunjuk. klik next.
16. Atur jam. Kemudian klik next.
17. Proses instalasi sudah selesai, maka akan muncul tampilan seperti berikut
18. Tampilan windows 7
21. Pilih US Keyboard kemudian klik next.
22. Akan muncul gambar seperti ini yaitu tampilan layar utama PC Linux. Akan terlihat banyak perbedaan antara windows dan linux.
26. Akan muncul tampilan konten harddisk. Use existing particions untuk menggunakan partisi yang kosong pada partisi microsoft windows. Pilihan yang kedua untuk menghapus dan kemudian menggunakan seluruh partisi. Pilihan ketiga adalah PC yang telah mengisi sebagian partisi System&data. Pilih custom disk partition, untuk memilih partisi yang biasa digunakan dan klik next.
27. Klik System&Data kemudian sebagai tempat Linux dan klik "Mount Point" untuk meletakkan dan menyusun linux pada parrisi tersebut.
28. klik ok
29. Pilih journalized FS: ext4 sesuai dengan file system linux.
30. klik done
33. Pada tahap ini partisi System&Data akan di format, seluruh data yang ada dalam partisi akan terhapus. Klik next.
34. Proses formating
35. Menginstall PCLinuxOS ke dalam komputer.
36. Klik next
37. Pilih linux(/Boot/vmlinuz) kemudian klik finish.
38. Klik finish. kemudian restart komputer dan keluarkan CD instalasi PCLinux.
39. Ini adalah tampilan awal ketika komputer baru dinyalakan. Dari pilihan tersebut kita dapat memilih mau masuk ke Linux atau ke windows.










































