JAWABAN RESPONSI


JAWABAN RESPONSI
Menurut kemampuan saya

#include<cstdlib>
#include<iostream>
#define maks 8
using namespace std;
class Array1D{
friend ostream& operator <> (istream&, Array1D&);
public:
Array1D();
void cetak();
void sisip();
private:
char A[maks];
};
Array1D::Array1D(){
for(int i=0; i<maks; i++){
A[i]='0';
}
}
void Array1D::cetak(){
for(int i=0; i<maks; i++){
cout << A[i] << " ";
}
cout <>(istream& in, Array1D& x){
int posisi;
cout <> posisi;
if(posisi>0 && posisi <=maks){
cout <> x.A[posisi-1];
}
else{
cout << "Array diluar range\n";
}
}
void Array1D::sisip(){
int posisi;
cout <> posisi;
int n = maks;
int temp = A[posisi-1];
for(int i=posisi-1; i0 && posisi <=maks){
cout <> A[posisi-1];

}
else{
cout <> A;
cin >> A;
cin >> A;
cin >> A;
cin >> A;
A.cetak();
A.sisip();
A.cetak();
cout << endl;
system("PAUSE");
return EXIT_SUCCESS;
}

About Sintata
Seek and Share Knowledge

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: