Tugas algoritma 8.1

Run Settings
LanguageC++
Language Version
Run Command
#include <iostream> #include <iomanip> using namespace std; void garis() { puts("==============================================="); } void judul() { garis(); puts("\t\tContoh Program Array"); garis(); } void author() { puts("Nama\t: la ode ian"); puts("Email\t: laodeian21@gmail.com"); } int main() { int jml; judul(); printf("Masukan Jumlah Data\t: "); cin >> jml; cout << endl; int absen[10], quis[10], tugas[10], uts[10], uas[10], total[10]; for (int i = 1; i <= jml; i++) { garis(); printf("Data ke-%d\n", i); printf("Masukan Nilai Absen\t: "); cin >> absen[i]; printf("\nMasukan Nilai Tugas\t: "); cin >> quis[i]; printf("\nMasukan Nilai UTS\t: "); cin >> uts[i]; printf("\nMasukan Nilai UAS\t: "); cin >> uas[i]; cout<< endl; total[i] = absen[i] + quis[i] + uts[i] + uas[i]; } garis(); puts("Data Yang Anda Masukan"); garis(); printf("No Absen Quis UTS UAS Total\n"); garis(); for (int i = 1; i <= jml; i++) { printf("%-3d %-6d %-5d %-4d %-4d %.2f\n", i, absen[i], quis[i], uts[i], uas[i], total[i] / 4.0); } garis(); author(); return 0; }
Editor Settings
Theme
Key bindings
Full width
Lines