contoh program class (bahasa C)

#include
#include
class Barang
{
private:
float Harga;
public:
void Masuk_Data(int hrg) {Harga=hrg;}
void Tampil_Data()
{
cout<<"\n Harga Barang="<<<"\n";}
};

void main()
{
clrscr();
Barang B1,B2;
B1.Masuk_Data(1000.0);
B2.Masuk_Data(1500.0);
B1.Tampil_Data();
B2.Tampil_Data();
getch();
}

Share this article :

0 comments:

Speak up your mind

Tell us what you're thinking... !

 
Support : Creating Website | Johny Template | Mas Template
Copyright © 2011. My Kampuzzzz - All Rights Reserved
Template Created by Creating Website Inspired by Sportapolis Shape5.com
Proudly powered by Blogger