Refleksi minggu keenam (ALPRO)
Wodoouuhh..Semua udah disiapin untuk kuliah minggu keenam alpro Ehh malah tidurnya yang kebablasan gara2 hp yang udah disetel alarmnya lowbat ,minggu ini jadi gk ikut alpro :(
Tag :
ALPRO
Menjumlahkan deret aritmatika secara rekursif (ALPRO)
#include <cstdlib>
#include <iostream>
using namespace std;
class deret{
public :
deret();
int tampil(int x,int b,int n);
private:
int x,b,n;
};
deret::deret()
{cout<<"\t\t\tPenjumlahan deret aritmatika"<<endl<<endl;
}
int deret::tampil(int x,int b,int n){
if(n==0){
return 0;
}
else {
return ((x+(n-1)*b)+tampil(x,b,n-1));
}
}
int main(int argc, char *argv[])
{
int p,q,r;
deret i;
cout<<"Masukkan batas awal : ";cin>>p;
cout<<"Masukkan beda : ";cin>>q;
cout<<"Masukkan banyak deret : ";cin>>r;
for(int s=0;s<r;s++)
{
cout<<p+s*q<<" ";
}
cout<<"\nJumlah dari seluruh deretnya adalah : "<<i.tampil(p,q,r)<<endl;;
system("PAUSE");
return EXIT_SUCCESS;
}
#include <iostream>
using namespace std;
class deret{
public :
deret();
int tampil(int x,int b,int n);
private:
int x,b,n;
};
deret::deret()
{cout<<"\t\t\tPenjumlahan deret aritmatika"<<endl<<endl;
}
int deret::tampil(int x,int b,int n){
if(n==0){
return 0;
}
else {
return ((x+(n-1)*b)+tampil(x,b,n-1));
}
}
int main(int argc, char *argv[])
{
int p,q,r;
deret i;
cout<<"Masukkan batas awal : ";cin>>p;
cout<<"Masukkan beda : ";cin>>q;
cout<<"Masukkan banyak deret : ";cin>>r;
for(int s=0;s<r;s++)
{
cout<<p+s*q<<" ";
}
cout<<"\nJumlah dari seluruh deretnya adalah : "<<i.tampil(p,q,r)<<endl;;
system("PAUSE");
return EXIT_SUCCESS;
}
Tag :
ALPRO
MEMBUAT WEB SEDERHANA (PROWEB)
1.Membuat web sederhana dengan layout table :
<html>
<head>
<title>IRHAS</title>
</head>
<body>
<table border="5"align="center" cellspacing="3">
<tr>
<td style="background-color:red"colspan="2"><center> <li><a href="file:///C:/Users/user/Documents/HTML/web.html"> BERANDA </a></li></center> </td>
<td style="background-color:red"colspan="4"> <center> Kunjungi :</center> </td>
</tr>
<tr>
<td style="background-color:red"colspan="2" width="500" height="220"><center>isi............<center></td>
<td style="background-color:red"colspan="4" width="150" height="110">
<ul>
<li><a href="http://twitter.com/ir_h4z/"> Follow Me </a></li>
<li><a href="http://www.google.com/"> Google Search </a></li>
<li><a href="http://www.yahoo.com/"> Yahoo search </a></li>
<li><a href="http://www.uad.ac.id/"> Web UAD </a></li>
</ul>
</td>
</tr>
<tr>
<td style="background-color:red"colspan="2"><center><li><a href="http://ranggakala.blogspot.com/"> Ke blog saya </a></li><center></td>
<td style="background-color:red"colspan="5"><center><li><a href="http://www.realmadrid.com/cs/Satellite/en/Prehome_ES2.htm"> Real Madrid </a><center></td>
</tr>
</table>
</body>
</html>
<head>
<title>IRHAS</title>
</head>
<body>
<table border="5"align="center" cellspacing="3">
<tr>
<td style="background-color:red"colspan="2"><center> <li><a href="file:///C:/Users/user/Documents/HTML/web.html"> BERANDA </a></li></center> </td>
<td style="background-color:red"colspan="4"> <center> Kunjungi :</center> </td>
</tr>
<tr>
<td style="background-color:red"colspan="2" width="500" height="220"><center>isi............<center></td>
<td style="background-color:red"colspan="4" width="150" height="110">
<ul>
<li><a href="http://twitter.com/ir_h4z/"> Follow Me </a></li>
<li><a href="http://www.google.com/"> Google Search </a></li>
<li><a href="http://www.yahoo.com/"> Yahoo search </a></li>
<li><a href="http://www.uad.ac.id/"> Web UAD </a></li>
</ul>
</td>
</tr>
<tr>
<td style="background-color:red"colspan="2"><center><li><a href="http://ranggakala.blogspot.com/"> Ke blog saya </a></li><center></td>
<td style="background-color:red"colspan="5"><center><li><a href="http://www.realmadrid.com/cs/Satellite/en/Prehome_ES2.htm"> Real Madrid </a><center></td>
</tr>
</table>
</body>
</html>
Dengan hasil tampilan seperti gambar berikut :
2.Membuat website sederhana dengan layout frame :
<html>
<head>
<title>IRHAS WEB</title>
</head>
<body>
<table border="7" align="center" cellspacing="5" width="600">
<tr>
<td style="background-color:red;"colspan="3">
<h1><center> I R H A Z </center></h1>
<li><center><a href="file:///C:/Users/user/Documents/HTML/asdas.html">HOME</center></li>
</td>
</tr>
<tr>
<td style="background-color:red" align="left" width="100" height="60">
<ul>
<li><a href="http://www.google.com/"> Google </a></li>
<li><a href="http://www.yahoo.com/"> Yahoo</a></li>
<li><a href="http://uad.ac.id">UAD</a></li>
</ul>
</td>
<td>
<table border="6" >
<tr>
<td style="background-color:red"co1span="2" width="500" height="110"><center>1</center></td>
<td style="background-color:red"co1span="2" width="500" height="110"><center>2</center></td>
<td style="background-color:red"co1span="2" width="500" height="110"><center>3</center></td>
</tr>
<tr>
<td style="background-color:red"co1span="2" width="500" height="110"><center>4</center></td>
<td style="background-color:red"co1span="2" width="500" height="110"><center>5</center></td>
<td style="background-color:red"co1span="2" width="500" height="110"><center>6</center></td>
</tr>
</table>
</td>
<td style="background-color:red"width="100" height="60">
<li><a href="http://ranggakala.blogspot.com/">My blog</a></li>
<li><a href="http://twitter.com/ir_h4z/">Follow me</a></li>
<li><a href="http://realmadrid.com/">Real madrid</a></li>
</td>
</tr>
<tr>
<td style="background-color:red;"colspan="3" >
<h3><center>Thank You</center></h3>
</td>
</tr>
</table>
</body>
</html>
Dengan hasil tampilan seperti gambar berikut :
Terima kasih :)
Tag :
Pemrograman Web
Praktikum 4 (ALPRO)
#include <cstdlib>
#include <iostream>
using namespace std;
class postest
{
public:
postest();
void faktorial();
void aritmatika();
private:
int i, x,n,a,b,hasil;
};
postest::postest(){
cout << "postest jam 09.00" << endl<<endl;
cout<<"\tIrhas"<<endl;
cout<<"\t12018052"<<endl<<endl;
}
void postest::faktorial(){
hasil=1;
cout<<"masukkan nilai faktorial :";
cin>>x;
for(i=1; i<=x; i++){
hasil = hasil*i;
if(i<x){
cout<<i<<"x";}
else{
cout<<i;
}
}
cout<<"\nhasil faktorial "<<x<<" = "<<hasil<<endl;
}
void postest::aritmatika(){
cout<<"masukkan jumlah deret :";
cin>>n;
cout<<"masukkan suku awal :";
cin>>a;
cout<<"masukkan beda :";
cin>>b;
for(i=0; i<n; i++){
cout <<a+(i*b)<<", ";
}
cout<<endl;
}
int main(int argc, char *argv[])
{
postest x;
x.faktorial();
cout<<endl;
x.aritmatika();
system("PAUSE");
return EXIT_SUCCESS;
}
#include <iostream>
using namespace std;
class postest
{
public:
postest();
void faktorial();
void aritmatika();
private:
int i, x,n,a,b,hasil;
};
postest::postest(){
cout << "postest jam 09.00" << endl<<endl;
cout<<"\tIrhas"<<endl;
cout<<"\t12018052"<<endl<<endl;
}
void postest::faktorial(){
hasil=1;
cout<<"masukkan nilai faktorial :";
cin>>x;
for(i=1; i<=x; i++){
hasil = hasil*i;
if(i<x){
cout<<i<<"x";}
else{
cout<<i;
}
}
cout<<"\nhasil faktorial "<<x<<" = "<<hasil<<endl;
}
void postest::aritmatika(){
cout<<"masukkan jumlah deret :";
cin>>n;
cout<<"masukkan suku awal :";
cin>>a;
cout<<"masukkan beda :";
cin>>b;
for(i=0; i<n; i++){
cout <<a+(i*b)<<", ";
}
cout<<endl;
}
int main(int argc, char *argv[])
{
postest x;
x.faktorial();
cout<<endl;
x.aritmatika();
system("PAUSE");
return EXIT_SUCCESS;
}
Tag :
ALPRO
Refleksi minggu keempat (alpro)
Pada minggu ini kami belajar tentang perulangan atau disebut dengan istliah "loop"..
Ternyata kuliah alpro semakin lama semakin susah ya :(
Tapi tetap semangaat !!!
Ternyata kuliah alpro semakin lama semakin susah ya :(
Tapi tetap semangaat !!!
Tag :
ALPRO
LOOP (ALPRO)
Kemampuan komputer untuk memnghitung perulangan sangatlah cepat dan akurat,untuk melakukan hal tersebut diperlukan suatu kondisi untuk menghitung perulangan sampai mana yang ditentukan.
* Algoritmik : i<-i+1
* C++ : i++ atau ++i
* Algoritmik : i<-i+1
* C++ : i++ atau ++i
Tag :
ALPRO
Pretest praktikum kedua (ALPRO)
Berikut ini adalah gambar flowchart (Raptor) untuk menampilakan nama bulan.
Caranya masukan bulan dalam angka yang ingin ditampilkan (1-12),jika memasukan angka lebih dari angka 12 maka akan di tampilkan "nama bulan tidak valid".
Contoh inputan seperti ini :
Setelah running akan ditampilkan hasil seperti ini :
Selamat mencoba :)
Caranya masukan bulan dalam angka yang ingin ditampilkan (1-12),jika memasukan angka lebih dari angka 12 maka akan di tampilkan "nama bulan tidak valid".
lanjutan dari gambar flowchart diatas
Contoh inputan seperti ini :
Setelah running akan ditampilkan hasil seperti ini :
Selamat mencoba :)
Tag :
ALPRO




