C++: HATSU Su Faturası Hesabı (2020 için)
x
26
26
1
2
/* ceil */
3
using namespace std;
4
int main()
5
{
6
int m3;
7
float sututari, kdv, atiksututari, ctv, toplam;
8
float fiyatm3 = 3.32, atiksum3 = 0.65, kdvorani = 0.08, ctvorani = 0.47;
9
cout << "Harcanan m3: ";
10
cin >> m3;
11
sututari = m3 * fiyatm3; // suyun fiyati
12
atiksututari = m3 * atiksum3; // atik su fiyati
13
ctv = m3 * ctvorani;
14
kdv = (sututari + atiksututari) * kdvorani;
15
kdv = (ceil(kdv * 100)) / 100; // kdv de yukari yuvarlama
16
17
toplam = sututari + atiksututari + ctv + kdv;
18
cout << endl << endl;
19
cout << "Kullanilan m3: " << m3 << endl;
20
cout << "Su tutari: " << sututari << endl;
21
cout << "Atik su tutari: " << atiksututari << endl;
22
cout << "CTV tutari: " << ctv << endl;
23
cout << "KDV tutari: " << kdv << endl;
24
cout << "Fatura toplami: " << toplam << endl;
25
return 0;
26
}