Answer:
#include <iostream>
using namespace std;
int main()
{
double annual_salary, save_percent, cost, current_savings = 0, r=0.04;
int months = 0;
cout<<"Enter your annual salary:"<<endl;
cin>>annual_salary;
cout<<"Enter the percent of your salary to save, as a decimal:"<<endl;
cin>>save_percent;
cout<<"Enter the cost of your dream house:"<<endl;
cin>>cost;
while(current_savings<(cost/4.0))
{
current_savings = current_savings + ((annual_salary/12.0)*save_percent) + (current_savings*(r/12.0));
months++;
}
cout<<"Number of months: "<<months;
return 0;
}