Kasus 3.4 Konversi Nilai.
Flowchartnya :
Program C++ :
#include < cstdlib >#include < iostream >using namespace std;class NILAI{public:void konversikan();private:float nilai;};void NILAI::konversikan(){cout<<"\n\n \t\t KONVERSI NILAI";cout<<"\n\nmasukkan nilai = ";cin>>nilai;if((nilai>0)&&(nilai<=20))cout<<"Nilai E"<else if((nilai>20)&&(nilai<=40))cout<<"Nilai D"<else if((nilai>40)&&(nilai<=60))cout<<"Nilai C"<else if((nilai>60)&&(nilai<=80))cout<<"Nilai B"<else if((nilai>80)&&(nilai<=100))cout<<"Nilai A"<elsecout<<"salah memasukkan angka (angka>100)"<}int main(int argc, char *argv[]){pick:NILAI;int q;cout<<"======================PILIHAN====================="<cout<<"1. Konversi nilai"<cout<<"2. Keluar/Exit"<cout<<"masukkan pilihan anda = ";cin>>q;switch(q){case 1: ku.konversikan();goto pick;break;case 2: return EXIT_SUCCESS;break;default: cout<<"\n\n \t\t PILIHAN SALAH"<}system("pause");return EXIT_SUCCESS;}