Skip to content

Instantly share code, notes, and snippets.

@corinchen
Created November 20, 2016 14:18
Show Gist options
  • Save corinchen/bcdfd62078c681c2be84e6056bd4d24c to your computer and use it in GitHub Desktop.
Save corinchen/bcdfd62078c681c2be84e6056bd4d24c to your computer and use it in GitHub Desktop.
hitung nilai akhir
//Program untuk menentukan nilai akhir melalui matriks GRADE dan BOBOT
#include<iostream>
using namespace std;
//fungsi nilai akhir
//bobot [k] bagaimana ya??
void cetak(float grade[50][50],int x, int y)
{
float bobot[50];
for(int i=1;i<=x;i++){
for(int j=1;j<=y;j++){
float cetak=grade[i][j]*bobot[j]/bobot[j];
cout<<" "<<grade[i][j];
cout << endl;
}
}
}
int main()
{
float z[50][50];
int x;
int y;
cout<<"Masukkan banyaknya soal : "<<endl;cin>>x;
cout<<"Masukkan banyaknya siswa : "<<endl;cin>>y;
for(int i=1;i<=x;i++){
cout<<"BOBOT SOAL ke "<<i<<endl;
for(int j=1;j<=y;j++){
cout<<"Masukkan nilai siswa ke "<<j<<" : "<<endl;cin>>z[i][j];
}
}
cetak(z,x,y);
}
@mochadwi
Copy link

Siib, done

Sudah diperbaiki programnya dan berjalan lancar. Btw, thanks for the initial algorithms.

Ohya, itu tahukan kalo mau jadi 5 siswa / lebih? sama, N soal?

tinggal ubah aja di grade[siswaN][soalN], akhir[siswaN], bobot[soalN]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment