PROGRAM MENGHITUNG BIAYA HIDUP PERTAHUN dan RATA BIAYA HIDUP PERBULAN dalam BENTUK C++

//PROGRAM MENGHITUNG BIAYA HIDUP PERTAHUN dan RATA2  BIAYA HIDUP PERBULAN

#include <iostream.h>

#include <conio.h>

void main ()

{

float ongkosHPB_1,ongkosHPB_2,ongkosHPB_3,ongkosHPB_4,ongkosHPB_5,ongkosHPB_6,

ongkosHPB_7,ongkosHPB_8,ongkosHPB_9,ongkosHPB_10,ongkosHPB_11,ongkosHPB_12,

jumlahOHT,rerataHPB;

cout<<“PROGRAM MENGHITUNG BIAYA HIDUP PERTAHUN dan RATA BIAYA HIDUP PERBULAN”<<endl;

cout<<“=============================++++++++++===============================”<<endl;

 

cout<<“masukkan ongkosHPB_1: “;  cin>>ongkosHPB_1;

cout<<“masukkan ongkosHPB_2: “;  cin>>ongkosHPB_2;

cout<<“masukkan ongkosHPB_3: “;  cin>>ongkosHPB_3;

cout<<“masukkan ongkosHPB_4: “;  cin>>ongkosHPB_4;

cout<<“masukkan ongkosHPB_5: “;  cin>>ongkosHPB_5;

cout<<“masukkan ongkosHPB_6: “;  cin>>ongkosHPB_6;

cout<<“masukkan ongkosHPB_7: “;  cin>>ongkosHPB_7;

cout<<“masukkan ongkosHPB_8: “;  cin>>ongkosHPB_8;

cout<<“masukkan ongkosHPB_9: “;  cin>>ongkosHPB_9;

cout<<“masukkan ongkosHPB_10: “; cin>>ongkosHPB_10;

cout<<“masukkan ongkosHPB_11: “; cin>>ongkosHPB_11;

cout<<“masukkan ongkosHPB_12: “; cin>>ongkosHPB_12;

jumlahOHT = ongkosHPB_1 + ongkosHPB_2 + ongkosHPB_3 + ongkosHPB_4 + ongkosHPB_5 +

ongkosHPB_6 + ongkosHPB_7 + ongkosHPB_8 + ongkosHPB_9 + ongkosHPB_10 +

ongkosHPB_11 + ongkosHPB_12;

cout<<“jumlahOHTnya adalah : “<<jumlahOHT<<endl;

rerataHPB = jumlahOHT / 12;

cout<<“rerataHPBnya adalah : “<<rerataHPB<<endl;

cout<<“==================”<<endl;

cout<<“Dibuat oleh”<<endl;

cout<<“WIDYA EKAWATI”<<endl;

cout<<“==================”<<endl;

getch ();

}

 

Run :

Advertisements
Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s