Good Evening,
I'm taking this introductory C++ class and i'm kinda confused with my code lol,I've pasted below both what is required and the code i have so far.Thanks
"
Prompt the user to enter a dog’s weight and number of days per month needing care,
then calculate and display the daily rate and the total for the month (days times the daily
rate)."
I'm taking this introductory C++ class and i'm kinda confused with my code lol,I've pasted below both what is required and the code i have so far.Thanks
"
Prompt the user to enter a dog’s weight and number of days per month needing care,
then calculate and display the daily rate and the total for the month (days times the daily
rate)."
Code:
int main()
{
int dogWeight,numOfDays;
cout << "Please enter the dog's weight" << endl;
cin >> dogWeight;
cout << "How many days per month does he need care? "<< endl;
cin >> numOfDays;
if (dogWeight <10 && numOfDays <10)
cout << "Your daily rate is " << 12 << " and your total for the month is " << 12*numOfDays << endl;
else
if (dogWeight <10 && numOfDays >10)
cout << "Your daily rate is " << 10 << " and your total for the month is " << 10*numOfDays << endl;
else
if (dogWeight =10<34 && numOfDays <10)
cout << "Your daily rate is " << 16 << " and your total for the month is " << 16*numOfDays << endl;
else
if (dogWeight =10<34 && numOfDays >10)
cout << "Your daily rate is " << 13 << " and your total for the month is " << 13*numOfDays << endl;
else
if (dogWeight >=35 && numOfDays <10)
cout << "Your daily rate is " << 19 << " and your total for the month is " << 19*numOfDays << endl;
else
if (dogWeight >=35 && numOfDays >10)
cout << "Your daily rate is " << 17 << " and your total for the month is " << 17*numOfDays << endl;
cout << "Press any key to continue ";
_getch();
return 0;
Comment