Breaking News
Loading...
Jumat, 06 Mei 2016

Halalaman 419

You will need separate arrays to hold the reveneu table, the unit totals(row sums) and the hospital quarterly totals (column sums)
Penyelesaian dengan ALGORITMA

Deklarasi :
I,j,max,temp : integer
Deskripsi :
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;


C++nya :

#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 :

0 komentar:

Posting Komentar

Copyright © 2014 My Blog My Adventure All Right Reserved