Advertisement
Guest User

Untitled

a guest
Apr 1st, 2013
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. // 14.cpp : Defines the entry point for the console application.
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "iostream"
  6. using namespace std;
  7.  
  8.  
  9. int main()
  10.  
  11. {
  12. double a, b, c, d, kids;
  13.  
  14.  
  15.  
  16.  
  17. cout << "Enter an employee's salary per hour ";
  18. cin >> a;
  19. cout << "Enter the number of hours he worked in the current week ";
  20. cin >> b;
  21.  
  22. cout << "How many kids does he have: ";
  23. cin >> kids;
  24. {
  25. if (kids > 2 && b > 40)
  26. const double c = b-40*(a*1.5)+40;
  27.  
  28. cout << "His weekly salaty is: " << c-(c*6/100)+(c*14/100)-10-35;
  29. }
  30. {
  31. if (kids <= 2 && b > 40)
  32. const double c = b-40*(a*1.5)+40;
  33.  
  34. cout << "His weekly salaty is: " << c-(c*6/100)+(c*14/100)-10;
  35. }
  36. {
  37.  
  38.  
  39. if (kids <= 2 && b <= 40)
  40. const double d = a*b;
  41.  
  42.  
  43. cout << "His weekly salaty is: " << d-(d*6/100)+(d*14/100)-10;
  44. }
  45. {
  46. if (kids > 2 && b <= 40)
  47. const double d = a*b;
  48.  
  49.  
  50. cout << "His weekly salaty is: " << d-(d*6/100)+(d*14/100)-10;
  51. }
  52. system("pause");
  53. return 0;
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement