#include <cstdlib>
#include <iostream>
using namespace std;
class hitung{
public:
void input();
void proses(int);
private:
int a,b,nilai,n;
};
void hitung::input(){
int i;
cout<<"jumlah mahasiswa = ";
cin>>n;
for(i=1;i<=n;i++){
cout<<"Masukkan nilai mahasiswa "<<i<<"=";
cin>>nilai;
proses(nilai);
cout<<endl;}
}
void hitung::proses(int nilai){
if(nilai>=0 && nilai<=25)
cout<<"D";
else if(nilai>=26 && nilai<=50)
cout<<"C";
else if(nilai>=51 && nilai<=80)
cout<<"B";
else if(nilai>=81 && nilai<=100)
cout<<"A";
else
cout<<"inputan salah";
}
int main(int argc, char *argv[])
{
hitung reza;
reza.input();
system("PAUSE");
return EXIT_SUCCESS;
}
0 komentar:
Posting Komentar