What's wrong with my if else then function? It complies fine (Dev C++) but it doesn't function properly. It displays all the messages together.
void data(void)
{
cout<<"How many hours did you work: ";
cin>> total_hours;
cout<<"How many days did you work: ";
cin>> days;
return;
}
void process
{
income_distrubution== ((income/ total_hours));
income= (days * 50);
return;
}
Void result
{
if(income> total_hours)
{
cout << "Error.";
}
if (income< (total_hours *.30))
{
cout<< "You need to work more!." << endl;
}
if((total_hours >= 0 && days >= 0 ))
{
cout<<"Your income distribution : "<< income_distrubution<<" % "<<endl;
}
else
{
cout<<"The number of hours/days entered must be greater than 0."<<endl;
}
Edit/Delete Message