create something new !!!
this a task from my PBO lecture ...
but it not finish yet ... :p
im using borland c++ 4.5
Maaf kawan2 yang menanti note saya di facebook
ni "statistic beta v0.41"
##### PROGRAM UTAMA #####
#include "tug.h"
#include
int main(){
int pilih;
sampel_data H;
ulang:
clrscr();
cout << " (_|_) :: ============ :: (_|_) " <<>> pilih;
switch (pilih){
case 0:
goto exit;
case 1:
H.ndata();
break;
case 2:
H.inputdata();
break;
case 3:
H.infodata();
break;
case 4:
H.sortas();
break;
case 5:
H.sortds();
break;
case 6:
H.median();
break;
case 7:
H.sdev();
break;
default:
cout << "\n PICAK MATA LOE !!!\n KETIK LAGI !!!" <<>> ws;
break;
}
goto ulang;
exit:
clrscr();
cout << "\n\n\n\t\t TERIMA KASIH TELAH MENGGUNAKAN PROGRAM SAYA " <<>> ws;
return 0;
}
###### HEADER ######
#ifndef tug_h
#define tug_h
#include
#include
template
class sampel_data{
public :
int n;
char penahan;
double data[100];
double jumlah,nilaimax,nilaimin,nilaitengah;
sampel_data(){} // konstruktor
void ratarata(){
sum();
cout << "Rata-rata Nilai adalah : " << temp =" n;" jumlah="0;" i="0;" jumlah =" jumlah" i="0;i < temp-1; i++){" cout=""><< " + " << i="0;" cout=""><< (i + 1) << " : "; cin >> data[i];
}
}
int ndata(){
int N;
cout << "\nMasukan Jumlah Data : "; cin >> N; return n=N;}
double median(){
int dv;
nilaitengah=0;
cout << "\ndata : "; for (int i=0;i < dv =" n/2;" nilaitengah =" data[dv]" tengah = " << nilaitengah/2 << endl; } else{ dv = (n/2); nilaitengah = data[dv]; cout << " tengah =" ">> penahan;
return nilaitengah;
}
void sortas(){
double temp;
for (int i =0; i < j="i+1;j"> data[j]){
temp=data[i];
data[i]=data[j];
data[j]=temp;
}
}
}
cout << "Data Telah diurutkan kecil ke besar... ";cin >> penahan;
}
void sortds(){
double temp;
for (int i =0; i < j="i+1;j" temp="data[i];">> penahan;
}
void max(){
nilaimax = data[0];
for (int i=0;i <> nilaimax)
nilaimax = data[i];
}
cout << "\ndata terbesar : " << nilaimin =" data[0];" i="0;i" nilaimin =" data[i];" i="0;i">> penahan;
}
};
#endif
Sekian dan terima kasih ...
No comments:
Post a Comment