B
Brian
#include <iostream>
#include <cmath>
using namespace std;
int water_bill(int usage_in_cubic_meters);
int main()
{
cout << "Enter the amount of usage in cubic meters: ";
return 0;
}
int water_bill(int usage_in_cubic_meters)
{
cin >> usage_in_cubic_meters;
if (usage_in_cubic_meters <= 0)
cout << "ERROR: please enter a number above 0.";
else if (usage_in_cubic_meters <= 1000)
cout << "Your bill is: $15";
else if (usage_in_cubic_meters > 3000)
cout << "Your bill is $70";
return usage_in_cubic_meters;
}
how come this wont go into the water_bill function and it just keeps
stopping after the main function?
#include <cmath>
using namespace std;
int water_bill(int usage_in_cubic_meters);
int main()
{
cout << "Enter the amount of usage in cubic meters: ";
return 0;
}
int water_bill(int usage_in_cubic_meters)
{
cin >> usage_in_cubic_meters;
if (usage_in_cubic_meters <= 0)
cout << "ERROR: please enter a number above 0.";
else if (usage_in_cubic_meters <= 1000)
cout << "Your bill is: $15";
else if (usage_in_cubic_meters > 3000)
cout << "Your bill is $70";
return usage_in_cubic_meters;
}
how come this wont go into the water_bill function and it just keeps
stopping after the main function?