Cara Membuat Program menghitung nilai akhir ( Nilai Tugas, Nilai UTS dan Nilai UN )
Flowchart
Script
#include <iostream>
#include <string>
using namespace std;
main(){ float nilai,good,tmb,krg,kli,bgi;
string nama;
string grade;
string keterangan;
cout<<"\n Selamat Datang";
cout<<"\n program niai akhir";
cout<<"\n\n Masukan Nilai UAS :";cin>>tmb;
cout<<" Masukan Nilai UTS :";cin>>krg;
cout<<" Masukan Nilai UN :";cin>>kli;
bgi = tmb+krg+kli;
nilai = (tmb+krg+kli)/3;
cout<<"\n\n Nilai Rata Rata :"<<nilai<<endl;
if (nilai >=85) {
grade=" A";
} else if (nilai >=70) {
grade=" B";
} else if (nilai >=55) {
grade=" C";
} else if (nilai >=40) {
grade=" D";
} else {
grade=" E";}
cout<<endl;
if (grade==" A") {
keterangan=" Best";
} else if
(grade==" B") {
keterangan=" Good";
} else if
(grade==" C") {
keterangan=" Enough";
} else if
(grade==" D") {
keterangan=" Less";
} else {
keterangan=" I don't know";
}cout<<" Anda mendapat Grade :"<< "("<<grade<<")"<<" Keterangan "<< keterangan <<endl;
cout<<"\n Rician Nilai :"<<tmb<<" + "<<krg<<" + "<<kli<<" = "<<bgi<<endl;
cout<<" :"<<bgi<<" /3 = ";
cout<< nilai <<endl; return 0 ;}
Hasil
Cara Membuat Program menghitung nilai akhir C++
Reviewed by YP
on
February 15, 2021
Rating:
No comments: