Edit-editan









Volume Balok, Volume Kerucut, dan Volume limas segitiga ( C++ )

Volume Balok

#include
#include

void main ()
{
int p, l, t, v;
cout<<" Masukkan Panjang : ";
cin>>p ;
cout<<" Masukkan Lebar : ";
cin>>l;
cout<<" Masukkan Tinggi : ";
cin>>t;
v=p*l*t;
cout<<"Volume= ";
cout<}


VOLUME LIMAS SEGITIGA

#include
#include

void main ()
{
double a, ts, t, v;
cout<<" alas segitiga : ";
cin>>a ;
cout<<" tinggi segitiga : ";
cin>>ts;
cout<<" tinggi limas : ";
cin>>t;
v=0.33*(a*ts*0.5)*t;
cout<<"Volume= ";
cout<}


VOLUME KERUCUT

#include
#include

void main ()
{
double r, ts, t, v;
cout<<" jari-jari lingkaran : ";
cin>>r ;
cout<<" tinggi kerucut : ";
cin>>t;
v=0.33*(3.14*r*r)*t;
cout<<"Volume= ";
cout<}

PROGRAM OPERASI ARITMATIKA (VISUAL BASIC)


Dim a1 As Single, a2 As Single
Dim hasil As Single

Private Sub Command1_Click()
Text1.Text = ""
Text2.Text = ""
Label3.Caption = ""
Option1 = False
Option2 = False
Option3 = False
Option4 = False
Option5 = False
Option6 = False
Option7 = False
Option8 = False
End Sub

Private Sub Option1_Click()
If Text1.Text = "" And Text2.Text = "" Then
MsgBox "Anda belum mengisi inputnya", vbInformation, "KESALAHAN!"
Option1 = False
Else
a1 = Text1.Text
a2 = Text2.Text
hasil = a1 ^ a2
Label3.Caption = hasil
End If
End Sub

Private Sub Option2_Click()
If Text1.Text = "" And Text2.Text = "" Then
MsgBox "Anda belum mengisi inputnya", vbInformation, "KESALAHAN!"
Option2 = False
Else
a1 = Text1.Text
a2 = Text2.Text
hasil = a1 - a2
Label3.Caption = hasil
End If
End Sub

Private Sub Option3_Click()
If Text1.Text = "" And Text2.Text = "" Then
MsgBox "Anda belum mengisi inputnya", vbInformation, "KESALAHAN!"
Option3 = False
Else
a1 = Text1.Text
a2 = Text2.Text
hasil = a1 * a2
Label3.Caption = hasil
End If
End Sub

Private Sub Option4_Click()
If Text1.Text = "" And Text2.Text = "" Then
MsgBox "Anda belum mengisi inputnya", vbInformation, "KESALAHAN!"
Option4 = False
Else
a1 = Text1.Text
a2 = Text2.Text
hasil = a1 / a2
Label3.Caption = hasil
End If
End Sub

Private Sub Option5_Click()
If Text1.Text = "" And Text2.Text = "" Then
MsgBox "Anda belum mengisi inputnya", vbInformation, "KESALAHAN!"
Option6 = False
Else
a1 = Text1.Text
a2 = Text2.Text
hasil = a1 \ a2
Label3.Caption = hasil
End If
End Sub

Private Sub Option6_Click()
If Text1.Text = "" And Text2.Text = "" Then
MsgBox "Anda belum mengisi inputnya", vbInformation, "KESALAHAN!"
Option6 = False
Else
a1 = Text1.Text
a2 = Text2.Text
hasil = a1 Mod a2
Label3.Caption = hasil
End If
End Sub

Private Sub Option7_Click()
If Text1.Text = "" And Text2.Text = "" Then
MsgBox "Anda belum mengisi inputnya", vbInformation, "KESALAHAN!"
Option7 = False
Else
a1 = Text1.Text
a2 = Text2.Text
hasil = a1 + a2
Label3.Caption = hasil
End If
End Sub

Private Sub Option8_Click()
If Text1.Text = "" And Text2.Text = "" Then
MsgBox "Anda belum mengisi inputnya", vbInformation, "KESALAHAN!"
Option8 = False
Else
a1 = Text1.Text
a2 = Text2.Text
hasil = a1 & a2
Label3.Caption = hasil
End If
End Sub

Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then

End If
If (KeyAscii = 48 Or KeyAscii = 49 Or KeyAscii = 50 Or KeyAscii = 51 Or KeyAscii = 52 Or KeyAscii = 53 Or KeyAscii = 54 Or KeyAscii = 55 Or KeyAscii = 56 Or KeyAscii = 57) Then
ElseIf (KeyAscii = vbKeyReturn Or KeyAscii = vbKeyDelete) Then
KeyAscii = 0
ElseIf KeyAscii = vbKeyBack Then
Else
KeyAscii = 0
MsgBox "Maaf, anda hanya bisa input angka saja!", vbInformation, "KESALAHAN"
Exit Sub
End If
End Sub

Private Sub Text2_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then

End If
If (KeyAscii = 48 Or KeyAscii = 49 Or KeyAscii = 50 Or KeyAscii = 51 Or KeyAscii = 52 Or KeyAscii = 53 Or KeyAscii = 54 Or KeyAscii = 55 Or KeyAscii = 56 Or KeyAscii = 57) Then
ElseIf (KeyAscii = vbKeyReturn Or KeyAscii = vbKeyDelete) Then
KeyAscii = 0
ElseIf KeyAscii = vbKeyBack Then
Else
KeyAscii = 0
MsgBox "Maaf, anda hanya bisa input angka saja!", vbInformation, "KESALAHAN"
Exit Sub
End If
End Sub


program lengkap download disini :
aritmatika2.rar
 

Usage Rights

DesignBlog BloggerTheme comes under a Creative Commons License.This template is free of charge to create a personal blog.You can make changes to the templates to suit your needs.But You must keep the footer links Intact.