C++: HATSU Su Faturası Hesabı (2020 için)

#include <iostream>
#include <math.h>       /* ceil */
using namespace std;

int main()
{
    int m3;
    float sututari, kdv, atiksututari, ctv, toplam;
    float fiyatm3 = 3.32, atiksum3 = 0.65, kdvorani = 0.08, ctvorani = 0.47;

    cout << "Harcanan m3: ";
    cin >> m3;

    sututari = m3 * fiyatm3; // suyun fiyati
    atiksututari = m3 * atiksum3; // atik su fiyati
    ctv = m3 * ctvorani;
    kdv = ( sututari + atiksututari ) * kdvorani;
    kdv = ( ceil( kdv * 100 ) ) / 100; // kdv de yukari yuvarlama
    toplam = sututari + atiksututari + ctv + kdv;

    cout << endl << endl;
    cout << "Kullanilan m3: " << m3 << endl;
    cout << "Su tutari: " << sututari << endl;
    cout << "Atik su tutari: " << atiksututari << endl;
    cout << "CTV tutari: " << ctv << endl;
    cout << "KDV tutari: " << kdv << endl;
    cout << "Fatura toplami: " << toplam << endl;

    return 0;
}

 

Share