Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h> #include <math.h> int main()
- {
- 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;
- int TP,j,CY,PY,MY,s,fy;
- j=2;
- s=1;
- printf("welcome to 'VALUE a STOCK' \n"); printf("\n");
- printf("enter CURRENT YEAR \t"); scanf("%d", &CY);
- printf("\n");
- printf("enter PAST YEAR \t"); scanf("%d", &PY);
- printf("\n");
- printf("enter FUTURE YEAR \t");
- scanf("%d", &fy);
- printf("\n");
- printf("enter the CURRENT BV: \t");
- scanf("%f", &eps);
- printf("\n");
- printf("enter the Present VALUE of stock \t");
- scanf("%f", &PV);
- printf("\n");
- printf("enter the average 12 months eps in year %d: \t",CY); scanf("%f", &cbv);
- printf("\n");
- TP=CY-PY+1;
- ftp=fy-PY;
- while(j<TP)
- {
- MY=CY-s;
- printf("enter the average 12 months eps in year %d: \t",MY); scanf("%f", &bv);
- printf("\n");
- sum=sum+bv;
- j++;
- s++;
- }
- printf("enter the average 12 months eps in year %d: \t",PY); scanf("%f", &obv);
- printf("\n");
- printf("enter the TOTAL DEBT/EQUITY :"); scanf("%f", &doe);
- printf("\n");
- printf("enter the CURRENT RATIO:"); scanf("%f", &cr);
- printf("\n");
- printf("\n");
- printf("enter the treasury yield (goverment securities market): \t"); scanf("%f", &GSM);
- printf("\n"); printf("------------------------------------------------------------------"); printf("\n");
- avg = (sum+cbv+obv) / TP;
- printf("The Average in EPS is=%.3f \n",avg); printf("\n");
- ce=cbv-obv;
- z=(ce*100)/obv;
- x=z-7.8;
- g=x/TP;
- fg=.75*g;
- printf("The Groth in EPS is:%.3f \n",g); printf("\n"); printf("---------------------------------");
- printf("\n");
- printf("The future expected Groth in EPS is:%.3f \n",fg); printf("\n");
- printf("---------------------------------");
- printf("\n");
- IV=(avg*(7.+(2*fg))*6.8)/GSM;
- printf("Intrinsic Value by average eps is: %.2f \n",IV); printf("\n");
- IVC=(cbv*(7.5+(2*fg))*6.8)/GSM;
- printf("Intrinsic Value by current eps is: %.2f \n",IVC); printf("\n");
- printf("---------------------------------");
- printf("\n");
- MS=(2*IVC)/3;
- printf("the MARGIN OF SAFTY is : %.2f",MS); printf("\n");
- if(MS >= PV || IVC>=PV)
- {
- printf("stock is under margin or intrinsic value"); printf("\n");printf("\n");
- } else{
- printf("WAIT for price to drope to MARGIN OF SAFTY or INTRINSIC VALUE");
- printf("\n"); }
- printf("\n"); printf("---------------------------------"); printf("\n");
- GN= sqrt(22.5*cbv*eps); n=(PV*PV)/(cbv*eps);
- printf("The GRAHAM NUMBER is: %.2f",GN); printf("\n");
- printf("Main ration (22.5): %.2f",n); printf("\n");
- printf("\n");
- if(n <= 25 & MS >= PV)
- {
- printf("stock is BEST to BUY NOW"); printf("\n");
- } else
- {
- printf("stock is over value");
- printf("\n"); }
- printf("\n"); printf("---------------------------------");
- printf("\n");
- ROE=(cbv*100)/eps;
- printf("the RATE OF EQUITY: %.2f",ROE);
- printf("\n");
- if(ROE>=8 & ROE<=12)
- {
- printf("\n");
- printf("stock is good perfomer"); printf("\n");
- } else
- {
- printf("\n");
- printf("stock is bad perfomer");
- printf("\n"); }
- printf("\n"); printf("---------------------------------");
- if(doe<=0.5 & doe>=0.05)
- {
- printf("\n");
- printf("stock has good chance to grow faster"); printf("\n");
- }
- printf("\n"); printf("---------------------------------"); if(cr>=1.5)
- {
- printf("\n");
- printf("stock has good at handling the debt in next 12 month");
- printf("\n"); }
- printf("\n"); printf("---------------------------------");
- printf("\n"); printf("**********************");
- if(ftp<=5)
- {
- fgiv=0.95;
- i=(avg*(7.5+(2*fgiv))*6.8)/PV; m=i/100;
- k=1+m;
- l = pow(k, ftp);
- fv=PV*l;
- printf("the future expected value in year %d is %.2f:",fy,fv);
- printf("**********************"); }
- if(ftp>=6 && ftp<=10)
- {
- fgiv=0.85;
- i=(avg*(7.5+(2*fgiv))*6.8)/PV;
- m=i/100; k=1+m;
- l = pow(k, ftp); fv=PV*l;
- printf("the future expected value in year %d is %.2f:",fy,fv); printf("**********************");
- }
- if(ftp>=11 && ftp<=20)
- {
- fgiv=0.80;
- i=(avg*(7.5+(2*fgiv))*6.8)/PV; m=i/100;
- k=1+m;
- l = pow(k, ftp);
- fv=PV*l;
- printf("the future expected value in year %d is %.2f:",fy,fv);
- printf("**********************"); }
- if(ftp>=21)
- {
- fgiv=0.75;
- i=(avg*(7.5+(2*fgiv))*6.8)/PV; m=i/100;
- k=1+m;
- l = pow(k, ftp);
- fv=PV*l;
- printf("the future expected value in year %d is %.2f:",fy,fv);
- printf("**********************"); }
- printf("\n"); printf("\n"); printf("\n"); printf("\n"); printf("\n");
- return 0; }
Add Comment
Please, Sign In to add comment