Baixe o app para aproveitar ainda mais
Prévia do material em texto
EXERCÍCIO LISTA 3 Program Exemplo_1; Var num: Integer; Begin Writeln ('digite um numero:'); Read (num); If(num < 0) Then Begin Writeln (' O valor digitado é invalido'); End Else If(num mod 2 = 0) and (num mod 3 = 0) Then Begin Writeln ('Esse numero é divisivel por 6'); End Else If(num mod 2 = 0) Then Begin Writeln ('Esse numero é divisivel por 2'); End Else If(num mod 3 = 0) Then Begin Writeln ('Esse numero é divisivel por 3'); End Else Writeln ('Esse valor não é divisivel por 2 ou 3'); Readkey; End. Program Exemplo_3 ; Var x: Real; Begin Writeln ('Digite o seu salario atual:'); Read (x); If((x > 0) and (x <= 200)) Then Begin Writeln (' Seu novo salario e:',x*1.13); End Else If((x > 200) and (x <=400)) Then Begin Writeln ('Seu novo salario e:',x*1.11); End Else If((x > 400) and (x <= 800)) Then Begin Writeln ('Seu novo salario e:',x*1.09); End Else If(x > 800) Then Begin Writeln ('Seu novo salario e:',x*1.07); End; Readkey; End. rogram Exercicio_5; Var x,y,dia,mes,ano,soma,resto: Integer; Begin Writeln ('Digite o ano que voce nasceu:'); Read (ano); x:= (ano - 1900); y:= (ano div 4); Writeln ('Digite o dia que voce nasceu:'); Read (dia); Writeln ('Digite o numero referente ao mes que voce nasceu:'); Writeln ('JANEIRO - 0'); Writeln ('FEVEREIRO - 3'); Writeln ('MARÇO - 3'); Writeln ('ABRIL - 6'); Writeln ('MAIO - 1'); Writeln ('JUNHO - 4'); Writeln ('JULHO - 6'); Writeln ('AGOSTO - 6'); Writeln ('SETEMBRO - 0'); Writeln ('NOVEMBRO - 3'); Writeln ('DEZEMBRO - 5'); Read (mes); soma:=(x+y+dia+mes); resto:=(soma mod 7); If(resto = 0) Then Begin Writeln ('voce nasceu no domingo'); End Else If(resto = 1) Then Begin Writeln (' voce nasceu em uma segunda-feira'); End Else If(resto = 2) Then Begin Writeln (' voce nasceu em uma terça-feira'); End Else If(resto = 3) Then Begin Writeln (' voce nasceu em uma quarta-feira'); End Else If(resto = 4) Then Begin Writeln (' voce nasceu em uma quinta-feira'); End Else If(resto = 5) Then Begin Writeln (' voce nasceu em uma sexta-feira'); End Else If(resto = 6) Then Begin Writeln (' voce nasceu em um sabado'); End; Readkey; End. Program Exercicio_6; Var dia: Integer; Begin Writeln ('Digite o numero a seguir para escolher o dia da semana:'); Writeln ('1 = Domingo'); Writeln ('2 = Segunda'); Writeln ('3 = Terça'); Writeln ('4 = Quarta'); Writeln ('5 = Quinta'); Writeln ('6 = Sexta'); Writeln ('7 = Sabádo'); Writeln ('Digite o respectivo numero:'); Read (dia); If (dia = 1) or (dia = 7) Then Begin Writeln ('É fim de semana'); End Else If (dia = 2) or (dia = 3) or (dia = 4) or (dia = 5) or (dia = 6) Then Begin Writeln ('É dia útil'); End Else If (dia > 7) Then Begin Writeln ('Codigo Invalido'); End; Readkey; End. Program Exemplo_7; Var matricula, resto: Integer; Begin Writeln ('Digite o numero da sua matricula'); Read (matricula); resto:= matricula mod 10; If(resto = 0) Then Begin Writeln (' se o resto for zero efetuar o pagamento em JANEIRO'); End Else If( resto = 1) Then Begin Writeln ('efetuar o pagamento em FEVEREIRO'); End Else If( resto = 2) Then Begin Writeln ('efetuar o pagamento em MARÇO'); End Else If( resto = 3) Then Begin Writeln ('efetuar o pagamento em ABRIL'); End Else If ((resto = 4) or (resto = 5) or (resto = 6) or (resto = 7) or (resto = 8) or (resto =9)) Then Begin Writeln ('efetuar o pagamento em MAIO'); End; Readkey; End.
Compartilhar