Aug 12, 2016 at 4:31pm UTC
hello!
guys, can you help me find the error? because my output has wrong.thanks
#include<iostream>
#include<iomanip>
using namespace std;
class Increment
{
private:
char name[40],ratings;
float Sc_Point;
public:
char set_name()
{
cout<<"Enter Name :";
cin>>name;
cout<<endl;
}
float set_Sc_Point()
{
cout<<"Score Point :";
cin>>Sc_Point;
cout<<endl;
}
float set_rating()
{
if(Sc_Point>=3.00 && Sc_Point<=4.00)
ratings='A';
if(Sc_Point>=2.00 && Sc_Point<=2.99)
ratings='B';
if(Sc_Point>=0.00 && Sc_Point<=1.99)
ratings='F';
}
};
int main()
{
Increment M;
char name,ratings;
float Sc_Point;
cout<<"========================================================="<<endl;
cout<<"\tAGENT INFORMATION\t"<<endl;
cout<<"========================================================="<<endl;
M.set_name();
M.set_Sc_Point();
M.set_rating();
cout<<"========================================================="<<endl;
cout<<"\tINCREMENT SLIP\t"<<endl;
cout<<"========================================================="<<endl;
cout<<"Name :"<<name<<endl;;
cout<<"Point Awarded :"<<Sc_Point<<endl;
cout<<"Rating :"<<ratings<<endl;
}
Aug 12, 2016 at 4:34pm UTC
What error? Why do you think there's an error? Why aren't you giving us the complete, specific information that would help us help you?
And please use code tags when posting code, to make it readable:
http://www.cplusplus.com/articles/z13hAqkS/
Last edited on Aug 12, 2016 at 4:35pm UTC