C + + program to print to the form of Text

Posted by Didi Setyapramana On 8:18 PM 0 komentar

# include <cstdlib>
# include <iostream>
# include <fstream>

using namespace std;

gasoline class {
public:
POM void ();
private:
int total;
float liter;
int jumlah_yang_dibeli;
int harga_satuan;

};
void gasoline:: POM () {
cout <<"Amount purchased:";
harga_satuan = 5000;
cin>> liter;
jumlah_yang_dibeli = harga_satuan * liter;
cout <<"unit price / liter Rp. 5000" <<endl;
int <<"total it all:" <<jumlah_yang_dibeli <<endl;


ofstream txt;
txt.open ("Struk.txt", ios:: app);

txt <<"Amount purchased:" <<jumlah_yang_dibeli <<endl;
txt <<"unit price / liter Rp. 5000" <<endl;
txt <<"Total it all:" <<jumlah_yang_dibeli <<endl;
txt <<"Thank you for your visit:" <<endl;
cout <<endl;

}
int main (int argc, char * argv [])
Gasoline {x;
x.POM ();

system ("PAUSE");
return EXIT_SUCCESS;
}

Categories:

0 Response for the "C + + program to print to the form of Text"

Post a Comment