arrayListType Programming C++

#include <iostream>
#include <string>
#include “arrayListType.h”

using namespace std;

int main()
{
arrayListType<int> intList(100);
arrayListType<string> stringList;

int number;

cout << “Masukkan 5 angka “;

for (int counter = 0; counter < 5; counter++)
{
cin >> number;
intList.insertAt(counter, number);
}

cout << endl;
cout<<“List data yang diinputkan “;
intList.print();
cout << endl;

cout << “hapus Salah satu data “;
cin >> number;
intList.remove(number);
cout << “hasil Remove data” << number
<< “list akhir” << endl;
intList.print();
cout << endl;

string str;

cout << “masukkan 5 string “;

for (int counter = 0; counter < 5; counter++)
{
cin >> str;
stringList.insertAt(counter, str);
}

cout << endl;
cout << “Masukkan 5 angka lagi ” << endl;
stringList.print();
cout << endl;

cout << “Hapus salah satu data “;
cin >> str;
stringList.remove(str);
cout << “setelah penghapusan data” << str
<< “data terakhir :” << endl;
stringList.print();
cout << endl;
return 0;
}

Advertisements

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