Selasa, 05 Juli 2011

Penjumlahan ( inputan tambah tiga)

This is one program in the sum, but the input of kayboart be in a specified sum in the formula processing, ie by inserting a formula that input titambah with three inputs, the results or output + 3, if you want to plus three and input + 5 if you want to add with five and so adjust as the one you add or you want by mengsetting again the formula in the program.

#include <iostream.h>
class Awal {
public :
void masukan();
void proses();
void keluaran();
private:
int a;
int hasil;
};
void Awal::masukan() {
cout << "Masukkan bilangan input : ";
cin >> a;
cout<<endl<<endl;}
void Awal::proses() {
hasil = 3 + a; }
void Awal::keluaran() {
cout << "Hasil keluaran dari proses : " <<hasil;
cout<<endl<<endl;}
int main(int argc, char *argv[]){
Awal X;
X.masukan();
X.proses();
X.keluaran();
system("PAUSE");
return EXIT_SUCCESS; }


Tidak ada komentar:

Posting Komentar