11.07.2015 Views

Lista 03a - DCC/UFMG

Lista 03a - DCC/UFMG

Lista 03a - DCC/UFMG

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

program l3p060;varC,CPF,NDEP: integer;RENDA,SALMIN,IMP,NSALMIN: real;beginwrite('Informe o salario minimo: ');readLn(SALMIN);for C := 1 to 10 dobeginwrite('CPF: ');readLn(CPF);write('N Dep: ');readLn(NDEP);write('Renda: ');readLn(RENDA);NSALMIN := RENDA / SALMIN;if ( NSALMIN < 2 ) thenIMP := 0else if ( NSALMIN < 3 ) thenIMP := RENDA*5/100else if ( NSALMIN < 5 ) thenIMP := RENDA*10/100else if ( NSALMIN < 7 ) thenIMP := RENDA*15/100elseIMP := RENDA*20/100;IMP := IMP - NDEP * (SALMIN*5/100);if ( IMP > 0 ) thenwriteLn('Imposto a ser pago: ',IMP:3:2)elsewriteLn('Imposto a ser restituído: ',-IMP:3:2);end;end.SALMIN = input('Informe o salario minimo: ');for C = 1 : 10CPF = input('CPF: ');NDEP = input('N Dep: ');RENDA = input('Renda: ');NSALMIN = RENDA / SALMIN;if ( NSALMIN < 2 )IMP = 0;elseif ( NSALMIN < 3 )IMP = RENDA*5/100;elseif ( NSALMIN < 5 )IMP = RENDA*10/100;elseif ( NSALMIN < 7 )IMP = RENDA*15/100;elseIMP = RENDA*20/100;endIMP = IMP - NDEP * (SALMIN*5/100);if ( IMP > 0 )fprintf(1,'Imposto a ser pago: %.2f\n',IMP);elsefprintf(1,'Imposto a ser restituído: %.2f\n',-IMP);endend<strong>UFMG</strong> – ICEx – <strong>DCC</strong> – Programação de Computadores – 2º. Sem 2005 – David Menoti 79

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!