Sunday, 2 October 2016

C++ - Menghitung Harga Buah Jeruk



#include <stdio.h>
#include <conio.h>
#include <iostream.h>

main()
{
float qty,harga=4500,tharga;

printf("\n ======================================================= \n");
printf("\n TOKO BUAH BIMA X \n");
printf("\n Jl. ABC Gang Jambu Rt01/01 Duren Karawang \n");
printf("\n ======================================================= \n");

printf("\n Buah : JERUK       \n");
printf("\n Harga : Rp.4.500,- \n");
printf("\n Qty : ");  scanf("%f",&qty);

// Hitung total harga
tharga=qty*harga;

printf("\n Total Harga: Rp.%.2f\n",tharga);
printf("\n =======================================================\n");
printf("\n TERIMA KASIH TELAH BERBELANJA\n");
printf("\n =======================================================\n");

getch();
}



Semoga Bermanfaat
Read More : C++ - Menghitung Harga Buah Jeruk

C++ - Menghitung Luas dan Volume Balok



#include <conio.h>
#include <iostream.h>
#include <stdio.h>

main()
{
float p,l,t,luas,volume;

cout<<"===============================================  "<<endl;
cout<<"MENGHITUNG LUAS DAN VOLUME BALOK     "<<endl;
cout<<"===============================================  "<<endl;

cout<<"Masukkan Panjang = " ; cin>>p;
cout<<"Masukkan Lebar = " ; cin>>l;
cout<<"Masukkan Tinggi = " ; cin>>t;

cout<<"===============================================  "<<endl;

//Rumus luas dan volume Balok
luas= 2*p*l + 2*p*t + 2*l*t;
volume= p*l*t;

cout<<"Luas balok= " <<luas   <<endl;
cout<<"Volume balok= " <<volume <<endl;

getch();
}



Semoga Bermanfaat
Read More : C++ - Menghitung Luas dan Volume Balok

  © Ratna-Always For You The Transformers by Blog Tips And Trick 2009