
Senin, 09 April 2012
praktikum 3 no 3
20.55
No comments
#include <iostream>
#include <string>
using namespace std;
class perulangan{
public:
perulangan(){i=1+3;}
void ulang_for();
void ulang_rekursif(int);
private:
int i;
};
void perulangan::ulang_for(){
while (!(i>20))
{
if (i % 2==1)
{
}
else
{
cout << i << endl; }
i =i+1;
}
}
int main(int argc, char *argv[])
{
perulangan bayu;
bayu.ulang_for();
system("PAUSE");
return 0;
}
#include <string>
using namespace std;
class perulangan{
public:
perulangan(){i=1+3;}
void ulang_for();
void ulang_rekursif(int);
private:
int i;
};
void perulangan::ulang_for(){
while (!(i>20))
{
if (i % 2==1)
{
}
else
{
cout << i << endl; }
i =i+1;
}
}
int main(int argc, char *argv[])
{
perulangan bayu;
bayu.ulang_for();
system("PAUSE");
return 0;
}
Kamis, 29 Maret 2012
Ujian 10 jari
02.09
No comments
alhamdulilah lulus.....hehe
moga tambah lancar ngetik 10 jarinya...amin
moga tambah lancar ngetik 10 jarinya...amin
refisi praktikum 2(menetukan tahun kabisat ataua bukan)
02.08
No comments
#include <cstdlib>
#include <iostream>
using namespace std;
class kabisat{
friend istream& operator>>(istream&, kabisat&);
public:
kabisat();//konstruktor
int step();
private:
int a;
};
kabisat::kabisat(){
cout<<"Menghitung tahun kabisat"<<endl;
cout<<"ALPRO siiipppp"<<endl;}
istream& operator>>(istream& in, kabisat& d){
cout<<"Masukan tahun: ";
in>>d.a;
}
int kabisat::step(){
if (a % 4==0){cout<<"Merupakan tahun kabisat";}
else {cout<<"Bukan kabisat";}
}
int main()
{
kabisat d;
cin>>d;
d.step();
cout<<endl;
system("PAUSE");
return EXIT_SUCCESS;
}
#include <iostream>
using namespace std;
class kabisat{
friend istream& operator>>(istream&, kabisat&);
public:
kabisat();//konstruktor
int step();
private:
int a;
};
kabisat::kabisat(){
cout<<"Menghitung tahun kabisat"<<endl;
cout<<"ALPRO siiipppp"<<endl;}
istream& operator>>(istream& in, kabisat& d){
cout<<"Masukan tahun: ";
in>>d.a;
}
int kabisat::step(){
if (a % 4==0){cout<<"Merupakan tahun kabisat";}
else {cout<<"Bukan kabisat";}
}
int main()
{
kabisat d;
cin>>d;
d.step();
cout<<endl;
system("PAUSE");
return EXIT_SUCCESS;
}
Praktikum ke 2(menetukan tahun kabisat atua bukan)
01.47
No comments
#include <cstdlib>
#include <iostream>
using namespace std;
class kabisat{
friend ostream& operator<<(ostream&, kabisat&);
friend istream& operator>>(istream&, kabisat&);
public:
kabisat();
int input();
int step();
private:
int a;
};
kabisat::kabisat(){
cout<<"Menghitung tahun kabisat"<<endl;
cout<<"ALPRO siiiiipp"<<endl;}
istream& operator>>(istream& in, kabisat& d){
cout<<"Masukan tahun: ";
in>>d.a;
}
int kabisat::step(){
if (a % 4==0){cout<<"Merupakan tahun kabisat";}
else {cout<<"Bukan kabisat";}
}
int main()
{
kabisat d;
cin>>d;
d.step();
cout<<endl;
system("PAUSE");
return EXIT_SUCCESS;
}
#include <iostream>
using namespace std;
class kabisat{
friend ostream& operator<<(ostream&, kabisat&);
friend istream& operator>>(istream&, kabisat&);
public:
kabisat();
int input();
int step();
private:
int a;
};
kabisat::kabisat(){
cout<<"Menghitung tahun kabisat"<<endl;
cout<<"ALPRO siiiiipp"<<endl;}
istream& operator>>(istream& in, kabisat& d){
cout<<"Masukan tahun: ";
in>>d.a;
}
int kabisat::step(){
if (a % 4==0){cout<<"Merupakan tahun kabisat";}
else {cout<<"Bukan kabisat";}
}
int main()
{
kabisat d;
cin>>d;
d.step();
cout<<endl;
system("PAUSE");
return EXIT_SUCCESS;
}
Minggu, 04 Maret 2012
menghitung luas & volume Kubus
20.31
No comments
#include <iostream.h>
#include <conio.h>
using namespace std;
class kubus {
private:
double s, l, v;
public:
void input();
double luas();
double volume();
void output();
};
void kubus::input(){
cout<<"masukan sisi kubus :";
cin>>s;
}
double kubus::luas(){
l =6*s*s;
return l;
}
double kubus::volume(){
v = s*s*s;
return v;
}
void kubus::output(){
cout<<"Luas Permukaan Kubus: "<<luas()<<endl;
}
int main(int argc, char *argv[])
{
kubus x;
x.input();
x.output();
cout<<endl;
system("PAUSE");
return EXIT_SUCCESS;
}
#include <conio.h>
using namespace std;
class kubus {
private:
double s, l, v;
public:
void input();
double luas();
double volume();
void output();
};
void kubus::input(){
cout<<"masukan sisi kubus :";
cin>>s;
}
double kubus::luas(){
l =6*s*s;
return l;
}
double kubus::volume(){
v = s*s*s;
return v;
}
void kubus::output(){
cout<<"Luas Permukaan Kubus: "<<luas()<<endl;
}
int main(int argc, char *argv[])
{
kubus x;
x.input();
x.output();
cout<<endl;
system("PAUSE");
return EXIT_SUCCESS;
}
Alpro (Meeting 2)
18.51
No comments
Today, learn about the Raptor.
which makes flowchar with raptor.
Still a bit confusing actually. Because it has not really understand about the raptor.
So it is still difficult.
But it's okay.
Because new things definitely need to learn and adapt.....*_*
which makes flowchar with raptor.
Still a bit confusing actually. Because it has not really understand about the raptor.
So it is still difficult.
But it's okay.
Because new things definitely need to learn and adapt.....*_*
Langganan:
Postingan (Atom)





