Analysis :
You will need separate arrays to hold the reveneu table, the
unit totals(row sums) and the hospital quarterly totals (column sums)
Algorithm :
Declaration :
I,j,max,temp : integer
Description :
Maxß
input
For(i=1;i<=max;i++)then
Write(“masukan data ke-i”)
For(i=1;i<=max;i++)then
Write(‘data[1]’)
For(i=1;i<=max;i++)then
For(j=1;j<=max;j++)then
If(data[i]>data[j])then
Write(‘temp=data[i])
Data[i]ßdata[j];
Data[j] ß
temp;
Dev C++
source code :
#include <iostream>
#include <cstdlib>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
using namespace std;
int main(int argc, char** argv) {
int i,j,max,temp;
int data[10];
cout<<"\t\t\t++++Summary of Hospital Revenue++++"<<endl<<endl;
cout<<"masukan banyak data : "; cin>>max;
for(i=1;i<=max;i++){
cout<<"\nmasukan data ke-"<<i<<" ; ";cin>>data[i];
}
cout<<"\ndata awal : ";
for(i=1;i<=max;i++){
cout<<data[i]<<" ";
}
for(i=1;i<=max;i++){
for(j=1;j<=max;j++){
if(data[i]>data[j]){
temp=data[i];
data[i]=data[j];
data[i]=temp;
}
}
}
return 0;
}
outputnya :
silahkan kunjungi juga alamat dibawah ini :
Tidak ada komentar:
Posting Komentar