Академический Документы
Профессиональный Документы
Культура Документы
DIGITAL ASSIGNMENT 1
NAME: Amitabh Mishra
Reg.no: 18BCI0225
Q1. For the data set given, create an Activity on Node diagram. Perform
Forward and Backward Pass to calculate Earliest Start, Earliest Finish, Latest
Start, Latest Finish, Float, Free Float and Interfering Float value for each of the
activities. Identify if there is any critical path in the network and highlight the
critical activities. Use the lucidchart tool to draw the diagram.
ANSWER:
From the above tables, we can make out the critical path which is:
1 -> 2 -> 4 -> 7 -> 5 -> 8 -> 9
And also the critical activities which are:
A, C, F, D, G, J
And the total project time is:
32
• Here are the calculated Earliest start, Earliest finish, Latest start, Latest
Finish, Float, Free Float and the Interfering Float values.
ANSWER:
CODE:
#include<iostream>
#include<stdio.h>
#include<math.h>
int main()
{int x,y,i,j,k,a[5][10];
float netprofit[5],avgprofit[5],roi[5];
double discountfactor[5][10],discountedcashflow[5][10],npv[5];
std::cout<<"\nEnter the number of projects\n";
std::cin>>x;
std::cout<<"\nEnter the number of years\n";
std::cin>>y;
for(i=0;i<x;i++)
{ std::cout<<"\n Enter the cash flow for project "<<i;
std::cout<<"\n Enter the initial investment ";
std::cin>>a[i][0];
for(j=1;j<=y;j++)
{ std::cout<<"\n Enter the value for year "<<j<<" ";
std::cin>>a[i][j];
}
}
for(i=0;i<x;i++)
{ netprofit[i]=0;
for(j=1;j<=y;j++)
netprofit[i]+=a[i][j];
netprofit[i]-=a[i][0];
}
for(i=0;i<x;i++)
std::cout<<"Net profit for project "<<i+1<<" is "<<netprofit[i]<<"\n";
for(i=0;i<x;i++)
{ avgprofit[i]=netprofit[i]/y;
std::cout<<"\n Average annual profit for project "<<i+1<<" is "<<avgprofit[i];
}
for(i=0;i<x;i++)
{ roi[i]=(avgprofit[i]/a[i][0])*100;
std::cout<<"\n ROI for project "<<i+1<<" is "<<roi[i];
}
for(i=0;i<x;i++)
{ std::cout<<"\n \nDiscount factors for project "<<i+1<<"\n";
for(j=0;j<=y;j++)
{ double x=pow(1.15,j);
discountfactor[i][j]=1/x;
std::cout<<"\n Discount factor for year "<<j<<" is "<<discountfactor[i][j];
}
}
for(i=0;i<x;i++)
{ for(j=0;j<=y;j++)
{
discountedcashflow[i][j]=discountfactor[i][j]*a[i][j];
}
}
for(i=0;i<x;i++)
{ npv[i]=0;
for(j=1;j<=y;j++)
npv[i]+=discountedcashflow[i][j];
npv[i]=npv[i]-discountedcashflow[i][0];
std::cout<<"\n NPV for project "<<i+1<<" is "<<npv[i];
}
return 0;
}
OUTPUT:
NET PROFIT
Net profit for project 1 is 45000
ROI
ROI for project 1 is 4.28571