desenvolvimento comercial de sistemas · praticando 1 desenvolva um aplicativo que calcule a média...

18
Desenvolvimento Comercial de Sistemas Prof.º Germano Marcos Escola Técnica Estadual Miguel Arraes de Alencar Blog: germanomarcos.wordpress.com E-mail: [email protected]

Upload: doanduong

Post on 12-Feb-2019

217 views

Category:

Documents


0 download

TRANSCRIPT

Desenvolvimento Comercial de Sistemas

Prof.º Germano Marcos

Escola Técnica Estadual Miguel Arraes de Alencar

Blog: germanomarcos.wordpress.com E-mail: [email protected]

Escola Técnica Estadual Miguel Arraes de Alencar

Prof.º Germano Marcos E-mail: [email protected]

Soma

Multiplicação

Subtração Divisão

Escola Técnica Estadual Miguel Arraes de Alencar

Prof.º Germano Marcos E-mail: [email protected]

Soma

Escola Técnica Estadual Miguel Arraes de Alencar

Prof.º Germano Marcos E-mail: [email protected]

Soma

Desenvolvendo as linhas de códigos

procedure TForm1.Button1Click(Sender: TObject); begin if (Edit1.Text <> '') and (Edit2.Text <> '') then begin Edit3.Text := FloatToStr(Strtofloat(edit1.Text) + Strtofloat(edit2.Text)); end; end;

Escola Técnica Estadual Miguel Arraes de Alencar

Prof.º Germano Marcos E-mail: [email protected]

Subtração

Escola Técnica Estadual Miguel Arraes de Alencar

Prof.º Germano Marcos E-mail: [email protected]

Desenvolvendo as linhas de códigos

procedure TForm1.Button1Click(Sender: TObject); begin if (Edit1.Text <> '') and (Edit2.Text <> '') then begin Edit3.Text := FloatToStr(Strtofloat(edit1.Text) - Strtofloat(edit2.Text)); end; end;

Subtração

Escola Técnica Estadual Miguel Arraes de Alencar

Prof.º Germano Marcos E-mail: [email protected]

Multiplicação

Escola Técnica Estadual Miguel Arraes de Alencar

Prof.º Germano Marcos E-mail: [email protected]

Desenvolvendo as linhas de códigos

procedure TForm1.Button1Click(Sender: TObject); begin if (Edit1.Text <> '') and (Edit2.Text <> '') then begin Edit3.Text := FloatToStr(Strtofloat(edit1.Text) * Strtofloat(edit2.Text)); end; end;

Multiplicação

Escola Técnica Estadual Miguel Arraes de Alencar

Prof.º Germano Marcos E-mail: [email protected]

Divisão

Escola Técnica Estadual Miguel Arraes de Alencar

Prof.º Germano Marcos E-mail: [email protected]

Desenvolvendo as linhas de códigos

procedure TForm1.Button1Click(Sender: TObject); begin if (Edit1.Text <> '') and (Edit2.Text <> '') then begin Edit3.Text := FloatToStr(Strtofloat(edit1.Text) / Strtofloat(edit2.Text)); end; end;

Divisão

Escola Técnica Estadual Miguel Arraes de Alencar

Prof.º Germano Marcos E-mail: [email protected]

Praticando 1

Desenvolva um aplicativo que calcule a média aritmética de quatro notas.

Escola Técnica Estadual Miguel Arraes de Alencar

Prof.º Germano Marcos E-mail: [email protected]

procedure TForm1.Button1Click(Sender: TObject); begin if (Edit1.Text <> '') and (Edit2.Text <> '') and (Edit3.Text <> '') and (Edit4.Text <> '') then begin Edit5.Text := FloatToStr((Strtofloat(edit1.Text) + Strtofloat(edit2.Text) + Strtofloat(edit3.Text) + Strtofloat(edit4.Text)) / 4); end; end;

Praticando 1

Escola Técnica Estadual Miguel Arraes de Alencar

Prof.º Germano Marcos E-mail: [email protected]

Praticando 1.2

Implemente no aplicativo desenvolvido no praticando 1 a mensagem ‘Preencha todas as notas’ caso o usuário os deixe sem valores.

Escola Técnica Estadual Miguel Arraes de Alencar

Prof.º Germano Marcos E-mail: [email protected]

procedure TForm1.Button1Click(Sender: TObject); begin if (Edit1.Text <> '') and (Edit2.Text <> '') and (Edit3.Text <> '') and (Edit4.Text <> '') then begin Edit5.Text := FloatToStr((Strtofloat(edit1.Text) + Strtofloat(edit2.Text) + Strtofloat(edit3.Text) + Strtofloat(edit4.Text)) / 4); end else begin ShowMessage('Preencha todas as notas'); end; end;

Praticando 1.2

Escola Técnica Estadual Miguel Arraes de Alencar

Prof.º Germano Marcos E-mail: [email protected]

Praticando 1.3 Implemente no aplicativo desenvolvido no praticando 1.2 o seguinte: Caso a média do aluno esteja >= 6 então deverá mostrar a mensagem ‘Parabéns, você está APROVADO!’ caso contrário deverá mostrar a mensagem ’Estude mais, você está reprovado.’

Escola Técnica Estadual Miguel Arraes de Alencar

Prof.º Germano Marcos E-mail: [email protected]

Praticando 1.3

procedure TForm1.Button1Click(Sender: TObject); begin if (Edit1.Text <> '') and (Edit2.Text <> '') and (Edit3.Text <> '') and (Edit4.Text <> '') then begin Edit5.Text := FloatToStr((Strtofloat(edit1.Text) + Strtofloat(edit2.Text) + Strtofloat(edit3.Text) + Strtofloat(edit4.Text)) / 4); if Strtofloat(edit5.Text) >= 6 then begin ShowMessage('Parabéns, você está APROVADO!'); end else begin ShowMessage('Estude mais, você está reprovado.'); end; end else begin ShowMessage('Preencha todas as notas'); end; end;

Escola Técnica Estadual Miguel Arraes de Alencar

Prof.º Germano Marcos E-mail: [email protected]

Praticando 1.4

Implemente no aplicativo desenvolvido no praticando 1.2 o seguinte: Além de mostrar a mensagem ‘Parabéns, você está APROVADO!’ ou ’Estude mais, você está reprovado.’ o campo da média deverá ficar verde se for >= 6 ou vermelho se for < 6.

Escola Técnica Estadual Miguel Arraes de Alencar

Prof.º Germano Marcos E-mail: [email protected]

Praticando 1.4

procedure TForm1.Button1Click(Sender: TObject); begin if (Edit1.Text <> '') and (Edit2.Text <> '') and (Edit3.Text <> '') and (Edit4.Text <> '') then begin Edit5.Text := FloatToStr((Strtofloat(edit1.Text) + Strtofloat(edit2.Text) + Strtofloat(edit3.Text) + Strtofloat(edit4.Text)) / 4); if Strtofloat(edit5.Text) >= 6 then begin Edit5.Color := clLime; ShowMessage('Parabéns, você está APROVADO!'); end else begin Edit5.Color := clRed; ShowMessage('Estude mais, você está reprovado.'); end; end else begin ShowMessage('Preencha todas as notas'); end; end;