-
-
Save corinchen/bcdfd62078c681c2be84e6056bd4d24c to your computer and use it in GitHub Desktop.
hitung nilai akhir
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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); | |
} |
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
@corinchen
coba yg ini ya:
https://gist.github.com/mochadwi/31ca117ccf8ea5254760dab90e468076
di laptop, ga ada compile-error sih. Berjalan sesuai perhitungan, tp ada runtime-error di akhir