Guest User

Untitled

a guest
Dec 15th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.11 KB | None | 0 0
  1. #include <stdio.h> #include <math.h> int main()
  2. {
  3. float sum= 0.0,avg,cbv,obv,ce,z,x,GSM,PV,GN,MS,n,bv,fv,i,k,l,ftp,ROE,eps,m,IVC,IV,fg,g, doe,cr,fgiv;
  4. int TP,j,CY,PY,MY,s,fy;
  5. j=2;
  6. s=1;
  7. printf("welcome to 'VALUE a STOCK' \n"); printf("\n");
  8. printf("enter CURRENT YEAR \t"); scanf("%d", &CY);
  9. printf("\n");
  10. printf("enter PAST YEAR \t"); scanf("%d", &PY);
  11. printf("\n");
  12. printf("enter FUTURE YEAR \t");
  13. scanf("%d", &fy);
  14. printf("\n");
  15. printf("enter the CURRENT BV: \t");
  16. scanf("%f", &eps);
  17. printf("\n");
  18. printf("enter the Present VALUE of stock \t");
  19. scanf("%f", &PV);
  20. printf("\n");
  21. printf("enter the average 12 months eps in year %d: \t",CY); scanf("%f", &cbv);
  22. printf("\n");
  23. TP=CY-PY+1;
  24. ftp=fy-PY;
  25. while(j<TP)
  26. {
  27. MY=CY-s;
  28. printf("enter the average 12 months eps in year %d: \t",MY); scanf("%f", &bv);
  29. printf("\n");
  30. sum=sum+bv;
  31. j++;
  32. s++;
  33. }
  34. printf("enter the average 12 months eps in year %d: \t",PY); scanf("%f", &obv);
  35.  
  36. printf("\n");
  37. printf("enter the TOTAL DEBT/EQUITY :"); scanf("%f", &doe);
  38. printf("\n");
  39. printf("enter the CURRENT RATIO:"); scanf("%f", &cr);
  40. printf("\n");
  41. printf("\n");
  42. printf("enter the treasury yield (goverment securities market): \t"); scanf("%f", &GSM);
  43. printf("\n"); printf("------------------------------------------------------------------"); printf("\n");
  44. avg = (sum+cbv+obv) / TP;
  45. printf("The Average in EPS is=%.3f \n",avg); printf("\n");
  46. ce=cbv-obv;
  47. z=(ce*100)/obv;
  48. x=z-7.8;
  49. g=x/TP;
  50. fg=.75*g;
  51. printf("The Groth in EPS is:%.3f \n",g); printf("\n"); printf("---------------------------------");
  52. printf("\n");
  53. printf("The future expected Groth in EPS is:%.3f \n",fg); printf("\n");
  54. printf("---------------------------------");
  55. printf("\n");
  56. IV=(avg*(7.+(2*fg))*6.8)/GSM;
  57. printf("Intrinsic Value by average eps is: %.2f \n",IV); printf("\n");
  58. IVC=(cbv*(7.5+(2*fg))*6.8)/GSM;
  59. printf("Intrinsic Value by current eps is: %.2f \n",IVC); printf("\n");
  60. printf("---------------------------------");
  61. printf("\n");
  62. MS=(2*IVC)/3;
  63. printf("the MARGIN OF SAFTY is : %.2f",MS); printf("\n");
  64.  
  65. if(MS >= PV || IVC>=PV)
  66. {
  67. printf("stock is under margin or intrinsic value"); printf("\n");printf("\n");
  68. } else{
  69. printf("WAIT for price to drope to MARGIN OF SAFTY or INTRINSIC VALUE");
  70. printf("\n"); }
  71. printf("\n"); printf("---------------------------------"); printf("\n");
  72. GN= sqrt(22.5*cbv*eps); n=(PV*PV)/(cbv*eps);
  73. printf("The GRAHAM NUMBER is: %.2f",GN); printf("\n");
  74. printf("Main ration (22.5): %.2f",n); printf("\n");
  75. printf("\n");
  76. if(n <= 25 & MS >= PV)
  77. {
  78. printf("stock is BEST to BUY NOW"); printf("\n");
  79. } else
  80. {
  81. printf("stock is over value");
  82. printf("\n"); }
  83. printf("\n"); printf("---------------------------------");
  84. printf("\n");
  85. ROE=(cbv*100)/eps;
  86. printf("the RATE OF EQUITY: %.2f",ROE);
  87. printf("\n");
  88. if(ROE>=8 & ROE<=12)
  89. {
  90. printf("\n");
  91. printf("stock is good perfomer"); printf("\n");
  92.  
  93. } else
  94. {
  95. printf("\n");
  96. printf("stock is bad perfomer");
  97. printf("\n"); }
  98. printf("\n"); printf("---------------------------------");
  99. if(doe<=0.5 & doe>=0.05)
  100. {
  101. printf("\n");
  102. printf("stock has good chance to grow faster"); printf("\n");
  103. }
  104. printf("\n"); printf("---------------------------------"); if(cr>=1.5)
  105. {
  106. printf("\n");
  107. printf("stock has good at handling the debt in next 12 month");
  108. printf("\n"); }
  109. printf("\n"); printf("---------------------------------");
  110. printf("\n"); printf("**********************");
  111. if(ftp<=5)
  112. {
  113. fgiv=0.95;
  114. i=(avg*(7.5+(2*fgiv))*6.8)/PV; m=i/100;
  115. k=1+m;
  116. l = pow(k, ftp);
  117. fv=PV*l;
  118. printf("the future expected value in year %d is %.2f:",fy,fv);
  119. printf("**********************"); }
  120. if(ftp>=6 && ftp<=10)
  121. {
  122. fgiv=0.85;
  123. i=(avg*(7.5+(2*fgiv))*6.8)/PV;
  124.  
  125. m=i/100; k=1+m;
  126. l = pow(k, ftp); fv=PV*l;
  127. printf("the future expected value in year %d is %.2f:",fy,fv); printf("**********************");
  128. }
  129. if(ftp>=11 && ftp<=20)
  130. {
  131. fgiv=0.80;
  132. i=(avg*(7.5+(2*fgiv))*6.8)/PV; m=i/100;
  133. k=1+m;
  134. l = pow(k, ftp);
  135. fv=PV*l;
  136. printf("the future expected value in year %d is %.2f:",fy,fv);
  137. printf("**********************"); }
  138. if(ftp>=21)
  139. {
  140. fgiv=0.75;
  141. i=(avg*(7.5+(2*fgiv))*6.8)/PV; m=i/100;
  142. k=1+m;
  143. l = pow(k, ftp);
  144. fv=PV*l;
  145. printf("the future expected value in year %d is %.2f:",fy,fv);
  146. printf("**********************"); }
  147. printf("\n"); printf("\n"); printf("\n"); printf("\n"); printf("\n");
  148. return 0; }
Add Comment
Please, Sign In to add comment