csenotes12

Question 23

Apr 9th, 2019
374
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include<iostream>
  2. using namespace std;
  3. #include<stdio.h>
  4. #include<conio.h>
  5. #include<iostream>
  6. #include<math.h>
  7. using namespace std;
  8. int main()
  9. {
  10. float pf,pfn,pm,pmn,mat,succ,success,fail,failure,et,pasr,losr,mr,fn,fi,pn;
  11. float n=1000000;
  12. cout<<"Time For A Page Fault For Empty Page :\n ";
  13. cin>>pf;
  14. pfn=pf*n;
  15. cout<<"Time For Modified Page :\n";
  16. cin>>pm;
  17. pmn=pm*n;
  18. cout<<"Enter Memory Access Time :\n";
  19. cin>>mat;
  20. cout<<"Reading Updated Page Percentage :\n";
  21. cin>>succ;
  22. success=succ/100;
  23. fail=100-succ;
  24. failure=fail/100;
  25. cout<<"Reading Unupdated Page Percetnage :"<<fail<<"%";
  26. cout<<"\nEnter The Effective Time : ";
  27. cin>>et;
  28. losr=failure*pfn;
  29. pasr=success*pmn;
  30. mr=mat+pasr+losr;
  31. fn=mat-mr;
  32. fi=mat-et;
  33. pn=fi/fn;
  34. system("cls");
  35. cout<<"Therefore Page Fault Related To Above Details is : ";
  36. cout<<"\n\n is : "<<pn<<"ns.\n";
  37. return 0;
  38. }
RAW Paste Data