When your question is answered use !solved to mark the question as resolved.
Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question run !howto ask.
17 messages · Page 1 of 1 (latest)
When your question is answered use !solved to mark the question as resolved.
Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question run !howto ask.
?
if I just make it a int will it destroy the remainder?
i have absolutely no context of your problem or question at all
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(){
int Years = 100;
int Houses = 0;
int CashFlowAnual=0;
double NetWorth=0;
int NetWorthMCF=0;
double TotalCash=0;
int AmountOf50K=0;
int AmountOf150K=0;
for(int i=0;i<Years;i++){
Houses = Houses + 1;
CashFlowAnual = 9600 * Houses;
TotalCash = 9600 * Houses + TotalCash;
NetWorthMCF = NetWorthMCF + (Houses*30000);
NetWorth = TotalCash + NetWorthMCF;
AmountOf50K = TotalCash/50000;
AmountOf150K = NetWorthMCF/150000;
if(AmountOf50K>1){
Houses = Houses*AmountOf50K;
TotalCash = TotalCash-50000*AmountOf50K;
}
if(AmountOf150K>1){
Houses = Houses*AmountOf150K*2;
NetWorthMCF = NetWorthMCF-50000*AmountOf50K;
}
printf("%d %f %f\n",CashFlowAnual, TotalCash, NetWorth);
}
}```
basically evry 50k I want a new house added to the house variable, and every 150k in networth I want 2 houses added to my house variable
ah
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(){
int Years = 100;
int Houses = 0;
int CashFlowAnual=0;
double NetWorth=0;
int NetWorthMCF=0;
double TotalCash=0;
int AmountOf50K=0;
int AmountOf150K=0;
for(int i=0;i<Years;i++){
Houses = Houses + 1;
CashFlowAnual = 9600 * Houses;
TotalCash = 9600 * Houses + TotalCash;
NetWorthMCF = NetWorthMCF + (Houses*30000);
NetWorth = TotalCash + NetWorthMCF;
AmountOf50K = TotalCash/50000;
AmountOf150K = NetWorthMCF/150000;
if(AmountOf50K>1){
Houses = Houses+AmountOf50K;
TotalCash = TotalCash-50000*AmountOf50K;
}
if(AmountOf150K>1){
Houses = Houses+AmountOf150K*2;
NetWorthMCF = NetWorthMCF-50000*AmountOf50K;
}
printf("%d %f %f\n",CashFlowAnual, TotalCash, NetWorth);
}
}
my numbers are messing up quiote a bit
something is up with my net worth
what are the expected results?
im not sure why its rising so high so fast
oh I see why
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(){
int Years = 100;
int Houses = 0;
int CashFlowAnual=0;
double NetWorth=0;
int NetWorthMCF=0;
double TotalCash=0;
int AmountOf50K=0;
int AmountOf150K=0;
int Ticker=0;
for(int i=0;i<Years;i++){
Ticker++;
Houses = Houses + 1;
CashFlowAnual = 9600 * Houses;
TotalCash = 9600 * Houses + TotalCash;
NetWorthMCF = NetWorthMCF + (Houses*30000);
NetWorth = TotalCash + NetWorthMCF;
AmountOf50K = TotalCash/50000;
AmountOf150K = NetWorthMCF/150000;
if(AmountOf50K>1){
Houses = Houses+AmountOf50K;
TotalCash = TotalCash-50000*AmountOf50K;
}
if(Years>5*Ticker){
if(AmountOf150K>1){
Houses = Houses+AmountOf150K*2;
NetWorthMCF = NetWorthMCF-150000*AmountOf150K;
}
}
NetWorth = TotalCash + NetWorthMCF;
printf("%d %f %f\n",CashFlowAnual, TotalCash, NetWorth);
}
}
```
@amber tulip My cashflow is climbing too high
it should only be selling the houses every 5 years