Question

In: Computer Science

*C programming* My friend Steve wants to buy something nice for himself. He doesn't know want...

*C programming*

My friend Steve wants to buy something nice for himself. He doesn't know want he wants yet but he is thinking of spending $1,000 on it or more. He makes $500 a month and has a monthly living expense of $325. He also has a lot of bi-monthly subscription payments which costs him $450 every other month ($450 is the bimonthly expenses) . He wants to know when he will be able to buy want he wants and still be able to pay his bills. He can work normal hours or work overtime and earn an extra $150 a month. Other things to consider are the tax rate (which is seven percent) and the amount of money he already has.

Solutions

Expert Solution

#include <stdio.h>
int main()
{
   int spend=1000,count=0;//Steve wants to spend money for him
   int month=500;//monthly salary
   int liv=325;//monthly living expenses
   int bi_m=450;// bi-monthly expenses
   int extra=150;//extra earn
   float has,interest=500*0.007;
   printf("Enter amount of money he already has: \t");
   scanf("%f",&has);
   if (has>=1000)
       printf("\nSteve can buy what he wants now\n");
   else
   {
       while (has<spend)
       {
           has+=month-interest-liv-bi_m/2+extra;
           count++;
       }
       printf("\nSteve can buy what he wants after %d months\n",count);
       return 0;
   }
}#include <stdio.h>
int main()
{
   int spend=1000,count=0;//Steve wants to spend money for him
   int month=500;//monthly salary
   int liv=325;//monthly living expenses
   int bi_m=450;// bi-monthly expenses
   int extra=150;//extra earn
   float has,interest=500*0.007;
   printf("Enter amount of money he already has: \t");
   scanf("%f",&has);
   if (has>=1000)
       printf("\nSteve can buy what he wants now\n");
   else
   {
       while (has<spend)
       {
           has+=month-interest-liv-bi_m/2+extra;
           count++;
       }
       printf("\nSteve can buy what he wants after %d months\n",count);
       return 0;
   }
}


Related Solutions

Your friend John has never learned Economics. He wants to know the differences between a change...
Your friend John has never learned Economics. He wants to know the differences between a change in the quantity demanded and a change in demand. He also wants to know the differences between a change in the quantity supplied and a change in supply. a) Explain to John the differences between a change in the quantity demanded and a change in demand. b) Explain to John the differences between a change in the quantity supplied and a change in supply.
After a car crash Mr Magoo wants to buy a used car. Just like all other buyers of used cars on the perfectly competitive market he is willing to pay 20000 USA for a lemon (a bad used car) and 50000 USA for a plum (a nice used car).
After a car crash Mr Magoo wants to buy a used car. Just like all other buyers of used cars on the perfectly competitive market he is willing to pay 20000 USA for a lemon (a bad used car) and 50000 USA for a plum (a nice used car). The sellers are prepared to sell lemons for a minimum of 10000 SEK and plums for 40000 USA. The buyers cannot distinguish the lemons from the plums when purchasing a car...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT