Friday, May 6, 2016

Problem Solving 419

Assalamuallaikum wr. wb.


Ebook Problem Solving 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;

=>Telah diselesaikan dengan  C++

#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;
}

=>Hasil compile adalah 



Semoga Bermanfaat untuk semua.!



Wassalamuallaikum wr. wb.

0 comments :

Post a Comment