//water
# include <iostream>
using namespace std;
int main()
{
char code;
int acc;
float ammwater;
float total;
//get the data
cout << " Insert acc number : ";
cin >> acc;
cout << " Type the code : " ;
cin >> code;
cout << " Ammount of water : " ;
cin >> ammwater;
// get the code
switch (code)
{
case 'H' :case 'h':
cout << " The bill for account number " << acc<< " is for home use " << endl;
total = 5.0 + ( ammwater * 0.0005 ) ;
cout << " The total payment would be $ " <<total<< ". Thank you" << endl;
break;
case 'C' : case 'c' :
cout << " The bill for account number " << acc << "is for commercial use " << endl;
if (ammwater <= 4000000 )
{
cout << " The total payment would be $ " <<1000<< ". Thank you" << endl;
}
else
{
total = 1000 + (ammwater - 4000000);
cout << " The total payment would be $ " << total << ". Thank you" << endl;
}
break;
case 'I' : case 'i ' :
{
cout << " The bill for account number " <<acc<< "is for industrial use" endl;
if (ammwater <= 4000000 )
{
cout << " The total payment would be $ " <<1000<< ". Thank you" << endl;
}
else if ( 4000000 < ammwater < 10000000 )
{
cout << " The total payment would be $ " <<2000<< ". Thank you" << endl;
else
{
cout << " The total payment would be $ " << 3000 << ". Thank you" << endl;
}
break;
default :
cout << " Syntax error, insert the right code. " << endl;
return code;
}
return 0;
}
in line 39 , the program state the error : "overflow in implicit constant conversion "
correct for me please, thank you