Nilai Tugas

=======================================
Tugas IV (31 Maret 2009 – 4 April 2009)
=======================================
1.Nurul Akhmaliyah                     Very Good
2.Yassin Rahmat Fadilla             Very Good
3.M.SAID ALKHUDRI                  Good
4.RIMA LESTARI                           Good
5.Eko                                                    Good
6.Nidia                                                 Good
7.Andika diapari                             Good
8.M. Arief Abdi Hasibuan            Good
9.Irfan Antoni Siregar                   Good
10.Seriching Emerlin                     Good
11.Ahmad Royhan Putra S          Good
12.Bilqis                                              Good
13.Alvi Syukriati Hsb                    Good
14.Nurul                                             Very Good
15.Yassin                                           Very Good
16.renol sahputra                           Good
17.nuzul sakinah lubis                  Good
18.Sohib Rosidi Siregar               Good
19.Deddy P. Sebayang                  Good
20.BIKSON HARA DONALD BARUS     Good
21.HENNI HARYANI LUBIS        Good
22.ahmad ihsan                                Good
23.dira fahrendy s                            Good
24.Nasan Martua                              Poor
25.Andronikus Simarmata           Poor
===========================================
Peserta        : 25 Orang

Very Good    : 4  Orang
Good        : 19 Orang
Poor        : 2  Orang
============================================

Jawaban Nya Adalah :

1.Resto Ilkom

#include<iostream>
#include<string>
#include<iomanip>
#include<conio.h>

using namespace std;

char   kode[3]  = {‘D’,’P’,’S’};
string jenis[3] = {“Dada “,”Paha “,”Sayap”};
long   harga[3] = {2500,2000,1500};
int    n[3], n_jenis, kode_i, i;
char kode_c;
long total;

int main(){
cout<<” Kode      Jenis      Harga  “<<endl;
cout<<“——————————“<<endl;
cout<<” D         Dada       Rp 2500″<<endl;
cout<<” P         Paha       Rp 2000″<<endl;
cout<<” S         Sayap      Rp 1500″<<endl;
cout<<“——————————“<<endl;
cout<<endl;
cout<<“Masukkan Jumlah Jenis   :  “;
cin>>n_jenis;
do{
cout<<“Masukkan kode [D/P/S] : “; cin>>kode_c;
if (kode_c == ‘D’ || kode_c == ‘d’) kode_i = 0;
else if (kode_c == ‘P’ || kode_c == ‘p’) kode_i = 1;
else if (kode_c == ‘S’ || kode_c == ‘s’) kode_i = 2;
else                                     kode_i = 3;
if (kode_i!=3) {
cout<<jenis[kode_i]<<” = “; cin>>n[kode_i];
i++;
} else {
cout<<“Kode tidak terdaftar\n”;
}
cout<<endl;
} while (i<n_jenis);

for ( i = 0 ; i < 3 ; i++ ){
if (n[i]!=0) cout<<jenis[i]<<” @ Rp.”<<harga[i]<<” = Rp. “<<harga[i]*n[i]<<endl;
total += harga[i]*n[i];
}
cout<<“TOTAL           = Rp. “<<total<<endl;
cout<<“Pajak           = Rp. “<<setprecision(12)<<total*0.1<<endl;
cout<<“TOTAL + Pajak   = Rp. “<<setprecision(12)<<total+total*0.1<<endl;

getch();
return 0;
}

2.Perkalian Matrix

#include <iostream>
#include <conio.h>
#include <stdio.h>
#include <iomanip.h>

using namespace std;

int main ()
{
int m,n,p,i,j,k;
int data1[10][10],data2[10][10],kali[10][10];

cout<<“Program Perkalian Matriks”<<endl;
cout<<“————————-“<<endl;
cout<<endl;
// Matriks A
cout<<“Matriks Pertama”<<endl;
cout<<“Jumlah Baris : “;
cin>>n;
cout<<“Jumlah Kolom : “;
cin>>m;
// Pemasukan elemen matriks A
for (i=0;i<=n-1;i++)
for (j=0;j<=m-1;j++)
{
cout<<“Nilai Baris “<<i+1
<<“,kolom “<<j+1<<” : “;
cin>>data1[i][j];
}
// Pencetakan elemen matriks A
cout<<“Matriks A”<<endl;
for (i=0;i<=n-1;i++)
{
for (j=0;j<=m-1;j++)
cout<<setw(4)<<data1[i][j];
cout<<“\n”;
cout<<endl;
}
// Matriks B
cout<<“Matriks Kedua”<<endl;
cout<<“Jumlah Baris : “;
cin>>m;
cout<<“Jumlah Kolom : “;
cin>>p;
// Pemasukan elemen matriks B
for (i=0;i<=m-1;i++)
for (j=0;j<=p-1;j++)
{
cout<<“Nilai Baris “<<i+1
<<“,kolom “<<j+1<<” : “;
cin>>data2[i][j];
}
// Pencetakan matriks B
cout<<“Matriks B”<<endl;
for (i=0;i<=p-1;i++)
{
for (j=0;j<=m-1;j++)
cout<<setw(4)<<data2[i][j];
cout<<“\n”;
cout<<endl;
}
for (i=0;i<n;i++)
{
for (j=0;j<p;j++)
{
kali[i][j]=0;
for (k=0;k<m;k++)
{
kali[i][j]=kali[i][j]+(data1[i][k]*data2[k][j]);
}
}
}
cout<<endl;
cout<<“Matriks A x Matriks B”<<endl;
cout<<endl;
for (i=0;i<n;i++)
{
for (j=0;j<p;j++)
{
cout<<setw(4)<<kali[i][j]<<” “;
}
cout<<endl;
cout<<endl;
}
getch ();
}

Iklan

2 Komentar »

  1. islamarket.net Said:

    ini blognya dosen ya?

    • fauzan1985 Said:

      iya…
      hehehe


{ RSS feed for comments on this post} · { TrackBack URI }

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout /  Ubah )

Foto Google+

You are commenting using your Google+ account. Logout /  Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout /  Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout /  Ubah )

Connecting to %s

%d blogger menyukai ini: