Hellko

asd

Mar 17th, 2013
38
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.12 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<math.h>
  3. const int god=2013;
  4. const double n=0.14;
  5.  
  6.  
  7. class payment {
  8. private:
  9.     int no, year, pro, ok, otr, ra, nach, ud, stajj, give;
  10.     char fio[120];
  11.     void calc(void);
  12. public:
  13.     payment(void);
  14.     payment(const char[120], int, int, int, int, int, int, int, int);
  15.     void show(void);
  16.  
  17. };
  18.  
  19. payment::payment(void) {
  20. no=0; year=0; pro=0; ok=0; otr=0; ra=0; nach=0; ud=0; stajj=0; give=0;
  21. printf("Enter: number, fio, oklad, otrabot, rabot, procent, god");
  22. scanf("%d%s%d%d%d%d%d", &no, &fio, &ok, &otr, &ra, &pro, &year);
  23. calc();
  24. }
  25.  
  26. payment::payment(const char fio1[120], int no1, int year1, int pro1, int ok1, int otr1, int ra1, int nach1, int stajj1) {
  27. no=no1; year=year1; pro=pro1; ok=ok1; otr=otr1; ra=ra1; nach=nach1; stajj=stajj1;
  28. for(int i=0;i<120;i++) fio[i]=fio1[i];
  29. calc();
  30. }
  31.  
  32. void payment::calc(void) {
  33. nach=ok/ra*otr*(1+pro/100);
  34. ud=nach*n;
  35. give=nach*(1-n);
  36. stajj=god-year;
  37. }
  38.  
  39. void payment::show(void) {
  40. printf("number=%d\n fio=%s\n stajj=%d\n nach=%d\n ud=%d\n give=%d\n", no, fio, stajj, nach, ud, give);
  41. }
  42.  
  43. int main() {
  44.     payment a;
  45.     a.show();
  46. }
Advertisement
Add Comment
Please, Sign In to add comment