Selasa, 06 Desember 2011

DESKRIPSI ANTRIAN TIKET BIOSKOP

NAMA : 1. FADLILLAH MUKTI AYUDEWI (10018052)
2. PENI SUKMA NUR PRATIWI (10018034)

Kali ini kelompok kami akan menjelaskan tentang kajian kelompok kami yang berjudul "ANTRIAN TIKET BIOSKOP di XXI" yang berada di Yogyakarta. Pelayanan pembelian tiket pada bioskop disini menggunakan pelayanan datang untuk mengantri.
Disini biasanya dibuka tiga loket untuk mengantri dengan judul film yang sama. Pengunjung yang datang diawal akan memempati posisi terdepan dalam pembelian tiket, kemudian dilanjutkan dengan pengunjung yang berada dibelakangnya. Namun karena disini terdapat tiga tiket dengan judul film yang sama maka tidak selalu pengunjung yang berada dibarisan setelah pembeli tiket akan mendapatkan tiket selanjutnya. Karena yang mendapatkan tiket selanjutnya bisa saja dari antrian sebelahnya. Apalagi disini juga terdapat sistem pembelian tiket secara online yang otomatis pembelian secara online ini akan didahulukan dengan kata lain ini berarti terdapat penyisipan dalam antrian. Disini dapat disimpulkan bahwa sistem mengantri dibioskop kurang efektif karena membuang waktu untuk mengantri dan tidak selalu semua pengunjung yang mengantri akan kebagian tiket.
Demikian Deskripsi dari kelompok kami, semoga dapat diterima dan bermanfaat . . .

DESCRIPTION MOVIE TICKET QUEUE

This time our group will describe our group's study, entitled "MOVIE TICKET QUEUE in XXI" in Yogyakarta. Service purchase tickets at the cinema here using your service comes to queue.
Here is normally opened three counters to queue up with the same title of the film. Visitors who come early will memempati leading position in the purchase of tickets, followed by visitors who stands behind it. However, because here there are three tickets with the same title of the film it is not always visitors who are dibarisan after ticket buyers will get the next ticket. Because who get tickets could have been further from the next queue. Moreover, here also there is an online ticket purchasing system that automatically purchase online this will take precedence in other words this means there is insertion in the queue. Here it can be concluded that the queuing system is less effective theaters for wasting time to wait in line and not always all the visitors who will miss the ticket queue.
Thus description of our group, may be acceptable and beneficial. . .

Selasa, 21 Juni 2011

Counting the roots of quadratic equation using the function class

class in c + + function to categorize the variables, class is almost the same as the struct, the difference is the class name can be changed while in stuctr can not.



Counting the roots of quadratic equation programs use the function class

#include

#include

#include

class Persamaan{

public:

Persamaan();

void hitung();

private:

double a,b,c;

double diskriminan,x1,x2,re,im;

};

int main()

{

Persamaan x;

x.hitung();

getch();

return 0;

}

Persamaan::Persamaan(){

cout << "Persamaan Kuadrat" << endl;



cout << "a : ";



cin >> a;

cout << "b : ";



cin >> b;

cout << "c : ";



cin >> c;

}

void Persamaan::hitung (){

// hitung diskriminan

diskriminan=b*b-4*a*c;

if(diskriminan > 0)

{

x1 = (-b + sqrt(diskriminan))/(2*a);

x2 = (-b - sqrt(diskriminan))/(2*a);

cout << "Akar real : " << endl;



cout << "x1 : " << x1 << endl;



cout << "x2 : " << x2 << endl;



}

else

if(diskriminan ==0)

{

x1=-b/(2*a);

x2=x1;

cout << "Akar kembar : " << endl;



cout << "x1 : " << x1 << endl;



cout << "x2 : " << x2 << endl;



}

else //diskriminan <0



{

re= -b/(2*a);

im= sqrt(fabs(diskriminan))/(2*a);

cout << "Akar kompleks : " << endl;



cout << "x1 : " << re <<" + " << im << endl;



cout << "x2 : " << re <<" - " << im << endl;



}

}

Print the prime numbers between 1-100 by function overloading






function and operator overloading are the two most important things in C + + programming language.

mekipun unique function, this function is not much different from other types of functions.

In C + +, a function call is not only determined by the function name, but also
by type and number of actual parameters.

Facilities relating to existing functionality
other in C + + is a template function, operator function, inline function.



The following is a program of Printing prime numbers between 1-100 by function overloading





#include

#include

#include

#include


class prog

{

friend istream & operator >> ( istream &, prog & );

friend ostream & operator << ( ostream &, prog & );


public:

void id();

prog();

char nama[60];

private:

float m;

float c;

float energi;


};

void prog::id()

{

cout << "Nama Program : ";


cin.getline( nama, 60 );

cout << endl;


}

prog::prog()

{


}

ostream & operator << ( ostream & out, prog & y )


{


{

int i,j,k;

cout<<"bilangan 1-100"<

for (i=2;i<=100;i++){


for (j=2;j<=i/2;j++){


k=i%j;

if (k==0 )break;

}if(k!=0)

cout<

}

}

return out;

}

int main()

{ cout << "\t\t\t# C++ #\n\n";



char nama[90] =

{

"Cetak Bilangan Prima "

};

cout << "Nama Program :" << nama << endl;


cout << "\n";



prog a;

cout << a;


getch();

return 0;

}



Senin, 20 Juni 2011

Pointer


POINTER

Pointer is a variable that contains the memory address of a
other variables.

This address is the location of other objects (usually other variables) in
memory.

For example, if a variable contains the address of another variable, the first variable
said pointing to the second variable


Pointer operators there are two, namely:

 Operator &

& Operator is unary (requires only one operand only).

Operator & produces the address of the operandnya.

 Operator *

* Are unary operators (requires only one operand only).

Operator * value that is at an address.





pointer declaration

Tipe_data * nama_pointer;



sample program using C + + pointers

#include

#include


using namespace std;


int main(int argc, char *argv[])

{


class node {

public :

int data;

node*berikut;

};


void main(){

//langkah satu

node*baru;

baru=new node;

baru->data=5;

baru->berikut=NULL;

cout<<"Isi data node baru adalah : "<data<


//langkah dua

node*lain;

lain=new node;

lain->data=6;

lain->berikut=NULL;

cout<<"Isi data node lain adalah : "<data<


//langkah tiga : menyambung rantai

baru->berikut=lain;

cout<<"Isi data node lain dicetak dari node baru adalah :";




cout<berikut->data<


//langkah empat

node*kepala=baru;

cout<<"mencetak node pertama dari pointer kepala :";




cout<data<


cout<<"Mencetak node kedua dari pointer kepala :";




cout<berikut->data<


//langkah lima : pointer yang jalan-jalan

cout<<"Menggunakan perulangan untuk mencetak setiap data pada rantai\n";




node*jalan=kepala;

int i = 1;

while(jalan !=NULL){

cout<<"Data ke-"<"<data<


i++;

jalan=jalan->berikut;

}

//langkah enam : bukti bahwa pointer data tidak kehilangan kepala

cout<<"Mencetak node pertama dari pointer kepala : ";




cout<data<


cout<<"Mencetak node kedua dari pointer kepala : ";




cout<berikut->data<


}


system("PAUSE");

return EXIT_SUCCESS;

}


Calculator program in C + +




calculator C + +


calculator C + +







calculator was created using C + + programming language and is divided into 3 files. Next functions

are:

void kalkulator::perpangkatan (){

system("cls");

int pil;

cout<<"1.Pangkat 2\n2.Pangkat 3";


cout<<"\nMasukkan pilihan : ";


cin>>pil;

switch(pil){

case 1:

cout<<"\nmasukkan nilai x : ";


cin>>x;

cout<<"hasil perpangkatannya adalah = "<

case 2:

cout<<"\nmasukkan nilai x : ";


cin>>x;

cout<<"hasil perpangkatannya adalah = "<

}

}


void kalkulator::akar_kuadrat (){

cout<<"masukan nilai x = ";


cin>> x;

hitung=sqrt(x);

cout<<"hasilnya adalah = "<

}

void kalkulator::exponensial (){

cout<<"masukan nilai x = ";


cin>> x;

hitung=exp(x);

cout<<"hasilnya adalah = "<

}

void kalkulator::sinus (){

cout<<"Sin dari = ";


cin>> x;

float pi =3.14;

hitung = sin (x*pi/180);

cout<<"hasilnya adalah = "<

}

void kalkulator::cosinus (){

cout<<"Cos dari = ";


cin>> x;

float pi =3.14;

hitung = cos (x*pi/180);

cout<<"hasilnya adalah = "<

}

void kalkulator::tangen (){

cout<<"Tangen dari = ";


cin>> x;

float pi =3.14;

hitung = tan (x*pi/180);

cout<<"hasilnya adalah = "<

}


Minggu, 19 Juni 2011

ListOurExpend



ListOurExpend

ListOurExpend







Tugas Proyek ALGORITMA DAN PEMROGRAMAN

List Our Expend adalah program yang digunakan untuk mencatat pengeluaran sehari-hari.

TUgas Proyek ini kita buat menggunakan applikasi Android sehingga dapat diinstal atau digunakan pada mobile yang berbasic Android.

Klik Download

Rabu, 25 Mei 2011

arithmetic series (deret aritmatika)

Arithmetic series in the field of mathematics is the sequence number in which the next number of additions to the previous number by a number of specific differences. Examples are 3,5,7,9,11,13, ..... Arithmetic series can be expressed with the following formula:

a, a + b, a + 2b, a + 3b, ...

In this case the n-th quarter:

\ a_n = a + (n - 1) b,

The total of all quarters:

S_n = \ frac {n} {2} (a + a_n) = \ frac {n} {2} [2a + (n-1) b].

For example, the sum total of a quarter to quarter of an = 3 + (n-1) (5) up to a quarter-50 is

S_ {50} = \ frac {50} {2} [2 (3) + (49) (5)] = 6.275.

Algorithm deret aritmatika :
Deklarasi:
float a, b, n, un, sn: Integer
int x;

Deskripsi:
For ← (x = a, x <= un, x = x + b) a 1.0 ←, b ← 2.0; ← printf ("+% i ", x); EndFor write (Deret aritmatika)
following his program c + + :


#include
#include

using namespace std;

int main(int argc, char *argv[])
{
//deklarasi data
float a,b,n,un,sn;
int x;
//badan program
printf("Program Penghitung Deret Aritmatika");
printf("\nMasukkan:");
printf("\nSuku ke n = ",n);
scanf("%f",&n);

a = 1.0;
b = 2.0;

un = a + (n-1)*b;
sn = (0.5*n)*(a+un);

printf("\nMaka Nilai dari Un = %f\n",un);
printf("\nNilai Sn = %f\n",sn);

printf("\nSelanjutnya\n");
printf("\nUn = %f\n",un);
printf("\nDeret aritmatika untuk %f adalah :\n\n",un);

for(x=a;x<=un;x=x+b) { printf("+%i ",x); } system("PAUSE"); return EXIT_SUCCESS; }

JAVA program Calculating Area and Volume of Balls

The ball is hand built curved space bounded by a curved area. The ball can be formed from the wake half-circle that rotated as far as 360 ° in diameter.

Algorithm to find the ball wide:

Input the radius = r
Input pi = 3.14
Calculate the area of ​​L = pi * r * r
Print Size L.


Volume ball search algorithm


Input the radius = r
Input pi = 3.14
Calculate the volume V = pi * r * r * r
Print Volume V.

The following program :

import jeliot.io.*;

public class GlobalMembers
{
public static void main()
{
libo x = new libo();
x.masukan();
System.out.print(" hasilnya adalah \n");
x.ngitung();
}
}

public class libo
{
public final void masukan()
{
System.out.print("masukkan nilai r :");
r = Input.readInt();
}
public final void ngitung()
{
pi +=3.14;
volume =(4/3)*pi*r*r*r;
luas =pi*r*r;
System.out.print("luas =");
System.out.print(luas);
System.out.print("\n");
System.out.print("volume =");
System.out.print(volume);
System.out.print("\n");
}
private int r;
private float pi ;
private float volume ;
private float luas ;

}

Menghitung Nilai Faktorial menggunakan Program JAVA

a glimpse of the factorial :

Here we let (n) as the number who would we look for value faktorialnya.
In mathematics the factorial of a bialngan formulated by:

n! = n * (n-1) ... ... * 1

or

n! = 1 * (n 1) ... ..* n


ALGORITHM calculate the factorial :

1.Tentukan fariabel i, n, factorial
2.faktorial = 1;
3.scanf (n)
4.for (i = 1; i <= n; i) {factorial = factorial * i;} 5.printf (factorial); 6.End.
The following java program :

import jeliot.io.*;


public class faktorial
{
public static void main (String[ ] args)
{
long limit = 20; // menghitung faktorial integer daeri 1 – 20
long faktorial = 1; // pendefinisian variabel faktorial

for (int i = 0; i <= limit; i++)
{
faktorial = 1;

for (int faktor = 2; faktor <= i; faktor ++)
faktorial *= faktor;
System.out.println (i + "!" + " adalah " + faktorial);
}
}
}

Program Menghitung Matrik Berordo 2x2

Sekilas tentang Matrik :

Notasi suatu matrik berukuran n x m ditulis dengan huruf besar dan dicetak tebal,
misalnya An×m. Huruf n menyatakan jumlah baris, dan huruf m jumlah kolom. Matrik
terdiri dari elemen-elemen matrik yang dinyatakan dengan huruf kecil diikuti
angka-angka indeks, misalnya aij , dimana i menunjukan posisi baris ke-i dan j
menentukan posisi kolom ke-j.


Berikut Program C++ untuk menghitung determinan matrik berordo 2x2 :

Algoritma :
1. Input a
2. Input b
3. Input c
4. Input d
5. Determinan = a*d-b*c

Program :

#include

int main()
{
int a,b,c,d,det;
cout<<"masukkan a :"; cin>>a;
cout<<"masukkan b :"; cin>>b;
cout<<"masukkan c :"; cin>>b;
cout<<"masukkan d :"; cin>>d;
det= a*d-b*c;
cout<<"determinan :"< return 0;
}

Minggu, 03 April 2011

simulation program to purchase fuel

task group:
1. Mukti Fadlillah Ayudewi (10018052)
2. Franecia Kartika (10018078)
3. Peni Sukma Nur Pratiwi (10018034)

simulation buy fuel with specifications:
Input form:
money / how many liters that will be purchased
Type of fuel to be purchased
Indicators will continue (increasing 0.1liter) for the total price / number of liters of fuel purchased not exceed demand
Output states:
The number of liters purchased (if the input in the form of money)
Total money to be paid (if the input in the form liter)

#include
#include

using namespace std;

int main(int argc, char *argv[])
{

class spbu (){
friend ostream& opreator<<(ostream&,spbu&); friend istream& operator>>(istream&,spbu&);
public :
void banyak();
void pilihan();
void hitung_liter();
void hitung_harga();
private :
int harga;
int Biaya;
int a,b ;
float hasil ;
float premium ;
float solar ;
float pertamax ;
};
void banyak::liter(){
cout<<"Masukkan berapa liter yang dibutuhkan : "; cin>>x;
}
void banyak::pilihan(){
cout<<"pilih 1 untuk premium\n"<>y;
}
void banyak::hitung_liter(){
float i = 0.0;
while(i <= x){
i = i + 0.1;
cout< }
}
void banyak::hitung_harga(){
float hasil = 0.0;
float premium = 4500;
float solar = 6000;
float pertamax = 8000;
if(y == 1)
hasil = x * premium;
else if(y == 2)
hasil = x * solar;
else if(y == 3)
hasil = x * pertamax;
cout<<"harga : "< }
void main(){
spbu :
banyak.banyak();
banyak.harga();
banyak.hitung_liter();
banyak.hitung_harga();


system("PAUSE");
return EXIT_SUCCESS;
}

program java menghitung nilai faktorial

Award as the value of factorial is the result of the multiplication of positive integers less than or equal to the value N. Writing is usually a factorial: n!

berikut programnya :

import jeliot.io.*;


public class faktorial
{
public static void main (String[ ] args)
{
long limit = 20; // menghitung faktorial integer daeri 1 – 20
long faktorial = 1; // pendefinisian variabel faktorial

for (int i = 0; i <= limit; i++)
{
faktorial = 1;

for (int faktor = 2; faktor <= i; faktor ++)
faktorial *= faktor;
System.out.println (i + "!" + " adalah " + faktorial);
}
}
}

Minggu, 27 Maret 2011

program memindahkan nilai a ke b dan b ke a (menggunakan jeliot)

public class MyClass {
public static void main() {
// Your algorithm goes here.

}
}
/* Program Pertukaran nilai A dan B */

class ProgramPertukaran
{
public static void main (String [] X)
{

/*Deklarasi Variabel*/

String nilaiA="dua"; // isi nilai A sebelum pertukaran
String nilaiB="delapan"; // isi nilai B sebelum pertukaran
String t;// tempat Sementara

/*Algoritma*/
/*Proses Pertukaran*/

t=nilaiA;/*simpan nilai A di tempat penampungan sementara*/
nilaiA=nilaiB;/*sekarang A dapat diisi dengan nilai B*/
nilaiB= t;/*isi B dengan nilai A yang semula ada di temp*/

/*tampilkan nilai setelah pertukaran*/
System.out.println("::Setelah Pertukaran::");
System.out.println("nilai A Sekarang ="+nilaiA);
System.out.println("nilai B sekarang ="+nilaiB);
}

}

program class c++ (memindahkan nilai a ke b dan b ke a )

#include
#include
class menukar {

public:
void swap ();

private:
int a,b;
};

void menukar::swap(){
cout<<"masukkan a :"; cin>>a;
cout<<"masukkan b :"; cin>>b;
cout<<"a="< cout<<"b="< }
int main(){
menukar angka;
angka.swap();
getch();
return 0;
}

Senin, 14 Maret 2011

Tugas Diskusi I

#include < iostream.h >
#include < conio.h >
using namespace std;

class konversi{
friend istream& operator>>(istream& , konversi&);
public:
konversi(unsigned int b=0){bilangan=b;}
void membilang1();
void membilang2();
void membilang3();
void membilang4();
void membilang5();
void membilang6();
void membilang7();
void konversikan();
private:
unsigned int bilangan;
};

istream&
operator>>
(istream& in, konversi& x){
cout <<"masukkan bilangan : ";
in>>x.bilangan;
return in;
}
void konversi::konversikan(){
if(bilangan<=11 || bilangan==100)membilang1();
else if(bilangan>19 && bilangan<=99)membilang3();
else if (bilangan>100 && bilangan<=999)membilang4();
else membilang2(); }

void konversi::membilang3(){
int satuan;
if(bilangan>19){
satuan=bilangan%10;
bilangan=bilangan/10;
konversikan();
cout<
<"puluh ";
if (satuan!=0) {
bilangan=satuan;
konversikan();}
}
}
void konversi::membilang1(){
switch(bilangan){
case 0:cout<<"nol ";
break;
case 1:cout<<"satu "; break;
case 2:cout<<"dua "; break;
case 3:cout<<"tiga "; break;
case 4:cout<<"empat "; break;
case 5:cout<<"lima "; break;
case 6:cout<<"enam "; break;
case 7:cout<<"tujuh "; break;
case 8:cout<<"delapan "; break;
case 9:cout<<"sembilan "; break;
case 10:cout<<"sepuluh "; break;
case 11:cout<<"sebelas "; break;
case 100:cout<<"seratus "; break;
default : cout<<"diluar range ";
}
}
void konversi::membilang2(){
int temp;
if(bilangan>11 && bilangan<20){
bilangan%=10;
membilang1();
cout<<"belas ";
}
else
membilang1();
}
void konversi::membilang4(){
int puluhan;
puluhan=bilangan%100;
if(bilangan>100 && bilangan<200){
cout <<"seratus ";
}
else
{
bilangan=bilangan/100;
konversikan();
cout<<"ratus ";}
bilangan=puluhan;
konversikan();
}
void konversi::membilang5(){
int ratusan;
ratusan=bilangan%1000;
if(bilangan>1000 && bilangan<2000){
cout <<"seribu ";
}
else
{
bilangan=bilangan/1000;
konversikan();
cout<<"ribu ";}
bilangan=ratusan;
konversikan();
}
void konversi::membilang6(){
int ribuan;
ribuan=bilangan%10000;
if(bilangan>10000 && bilangan<20000){
cout <<"puluhan ribu ";
}
else
{
bilangan=bilangan/10000;
konversikan();
cout<<"puluhan ribu ";}
bilangan=ribuan;
konversikan();
} void konversi::membilang7(){
int puluhan_ribu;
puluhan_ribu=bilangan%100000;
if(bilangan>100000 && bilangan<200000){
cout <<"seratus ribu ";
}
else
{
bilangan=bilangan/100000;
konversikan();
cout<<"ratusan ribu ";}
bilangan=puluhan_ribu;
konversikan();
}
int main(){
konversi a;
cin>>a;
a.konversikan();
cout<
system("PAUSE");
return EXIT_SUCCESS;
}

Tugas Individu Minggu ke-2


1.       algoritma dan program untuk mencari titik tengah sebuah garis yang ujung titiknya adalah A(x1,y1) dan B(x2,y2).
Input = A(x1,y1)
                B(x2,y2)
Output = mencetak titik tengah sebuah garis (xT,yT)
·         Algoritma
1.       masukan x1
2.       masukan x2
3.       masukan y1
4.       masukan y2
5.       hitung titik tengah xT
6.       hitung titik tengah yT
7.       Tampilkan T(xT,yT)

·         Program dari Algoritma diatas
#include <iostream>
class Titik{
      friend istream& operator>>(istream& ,Titik&);
      friend ostream& operator<<(ostream& ,Titik&);
      public:
             Titik();
             float titik1();
             float titik2();
      private:
             float x1, x2;
             float y1, y2;
             float TitikTengahx;
             float TitikTengahy;
             };
Titik::Titik(){
               }
float Titik :: titik1(){
                TitikTengahx=(x1+x2)/2;
                return TitikTengahx;
      }
float Titik :: titik2(){
      TitikTengahy=(y1+y2)/2;
      return TitikTengahy;
      }
istream& operator>>(istream& in, Titik& M){
         cout<<"PROGRAM MENGHITUNG TITIK TENGAH"<<endl;
         cout<<"masukkan nilai x1 dan x2 : ";
         in>>M.x1>>M.x2;
         cout<<"masukkan nilai y1 dan y2 : ";
         in>>M.y1>>M.y2;
         return in;
   }

ostream& operator<<(ostream& out, Titik& M){
        out<<"titik tengahnya adalah :("<<M.titik1()<<" , "<<M.titik2()<<")";
        return out;
   }
int main(){
        Titik x;
        cin>>x;
        cout<<x;
      return 0;
}










 2.       algoritma dan program untuk memisahkan bilangan integer yang kurang dari 1000 menjadi komponen- komponennya.
·         Algoritma
Input a( 3 digit)
1.       a/100             = a1
2.       a mod 100   = b
3.       b/10               = b1
4.       b mod 10     = c
5.       c/1                  = c1
- program dari algoritma diatas : 







3.       algoritma dan program untuk menghitung determinan matriks berordo 2x2
·         Algoritma
1.       Input a
2.       Input b
3.       Input c
4.       Input d
Determinan                = axd-bxc
program dari algoritma diatas :








Jumat, 11 Maret 2011

Algoritma dan Pemrograman

  •  ALGORITMA
Algoritma kegiatan sehari-hari dari bangun tidur sampai berangkat ke kampus
 1. bangun pagi kemudian sholat subuh.
 2. mandi kemudian beres-beres kamar kos.
 3. baca buku kemudian mainan komputer.
 4. berangkat ke kampus.

  • PROGRAM C++ dari ALgoritma diatas :













  • FLOWCHARTdari algoritma diatas