contoh program dengan fungsi() menghitung pajak

1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include <iostream>
#include <conio.h>
using namespace std;

int pajak( float cost1, float count1 ) {
 float total, tax, total2;
 total = cost1*count1;
 tax = total*0.1;
 total2 = total + tax;
 cout<<"\nPajak: "<<tax;
 cout<<endl;
 cout<<"---------------------------------------------"<<endl;
 cout<<"\nTotal Harga Yang di Bayar = "<<total2;
}//END FUNCTION

void pertama() {

 float cost, count, total;
 cout<<"Harga Barang yang dibeli: ";
 cin>>cost;
 cout<<"Total Yang di Beli: ";
 cin>>count;
 total = cost*count;
 cout<<"Total Harga: "<<total<<endl;
 pajak( cost, count );

}//END FUNCTION

int main() {

 pertama();
 getch();

}//END FUNCTION


Program C++ Menghitung pajak (fungsi)

Komentar

Posting Komentar

Postingan Populer