-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathInstructionsToTheAssignment
104 lines (73 loc) · 2.26 KB
/
InstructionsToTheAssignment
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
for the assignment we want to know 4 things namely
The monthly earnings
The return on investment
The estimated current value
The capital gains
so the above functions will act as functions for which we will get a value
there will be 3 sub structures , 1 main structure
each substructure for appartments , townhouses ,semi detached houses
the main structure will have the following information:
char name[34]
char address[64]
struct appartments appartment[5]
struct townhouses townhouse[5]
struct semi detached houses[5]
Sub structures are as following
struct appartment{
char address[64]
int Nrooms
int Nbathrooms
int PurchasePrice
double MonthlyRent
double MonthlyCfees
double MonthlyEarnings
double annualReturn
double CurrentV
double CapitalG
}
struct townhouse{
char address[64]
int Nrooms
int Nbathrooms
int Pprice
double MonthlyRent
double MonthlyUtilities
double MonthlyCFees
double MonthlyPropertyTax
double MonthlyEarnings
double annualReturn
double CurrentV
double CapitalG
}
struct semi_detached{
char address[64]
int Nrooms
int Nbathrooms
double Pprice
double MonthlyRent
double MonthlyUtilities
double MonthlyProperty
double MonthlyPropertyTax
double MonthlyEarnings
double annualReturn
double CurrentV
double CapitalG
}
for the functions the following calculations wil take place
double MonthlyEarnings(double MonthlyRent,double MonthlyUtilities ,double MonthlyPropertyTax){
monthly earnings = monthly rent - monthly utilities - monthly property tax;
}
double ReturnOnInvestment(double MonthlyEarnings,double Pprice){
rinvestment=100*12*MonthlyEarnings/Pprice
}
double CurrentValue(double MonthlyEarnings){
cvalue=12*MonthlyEarnings/interest rate(this is a value which will be pre defined in the main code , as 0.05)
}
double CapitalGains(double CurrentValue, Double Pprice){
CapitalG=currentvalue-Pprice
}
This sums up all our functions
now a code has been added by professor on his website , we shall use that code to get the required data for our structures ,
also before inserting the values inside the structure make a function that initializes the array of our structure .
thats it for the whole code
i’ll be making a skeletal code and publishing on github , check that out too , and make the required changes and then post them on github again , thanks