Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<math.h>
- const int god=2013;
- const double n=0.14;
- class payment {
- private:
- int no, year, pro, ok, otr, ra, nach, ud, stajj, give;
- char fio[120];
- void calc(void);
- public:
- payment(void);
- payment(const char[120], int, int, int, int, int, int, int, int);
- void show(void);
- };
- payment::payment(void) {
- no=0; year=0; pro=0; ok=0; otr=0; ra=0; nach=0; ud=0; stajj=0; give=0;
- printf("Enter: number, fio, oklad, otrabot, rabot, procent, god");
- scanf("%d%s%d%d%d%d%d", &no, &fio, &ok, &otr, &ra, &pro, &year);
- calc();
- }
- payment::payment(const char fio1[120], int no1, int year1, int pro1, int ok1, int otr1, int ra1, int nach1, int stajj1) {
- no=no1; year=year1; pro=pro1; ok=ok1; otr=otr1; ra=ra1; nach=nach1; stajj=stajj1;
- for(int i=0;i<120;i++) fio[i]=fio1[i];
- calc();
- }
- void payment::calc(void) {
- nach=ok/ra*otr*(1+pro/100);
- ud=nach*n;
- give=nach*(1-n);
- stajj=god-year;
- }
- void payment::show(void) {
- 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);
- }
- int main() {
- payment a;
- a.show();
- }
Advertisement
Add Comment
Please, Sign In to add comment