TrabalhosGratuitos.com - Trabalhos, Monografias, Artigos, Exames, Resumos de livros, Dissertações
Pesquisar

Trabalho

Por:   •  2/11/2015  •  Projeto de pesquisa  •  419 Palavras (2 Páginas)  •  120 Visualizações

Página 1 de 2

//---------------------------------------------------------------------------

#include <vcl\vcl.h>

#pragma hdrstop

#include "Unit1.h"

//---------------------------------------------------------------------------

#pragma resource "*.dfm"

TForm1 *Form1;

float num=0;

//---------------------------------------------------------------------------

__fastcall TForm1::TForm1(TComponent* Owner)

: TForm(Owner)

{

}

//---------------------------------------------------------------------------

void __fastcall TForm1::Button2Click(TObject *Sender)

{

switch(MessageBox(Handle,"Sim = Mostrar tabela \n\nNão = Ocultar tabela","Escolha:",MB_YESNO | MB_ICONQUESTION))

{

case ID_YES :

{ Image1->Visible=True;

goto fim;

}

case ID_NO :

{ Image1->Visible=False;

}

fim:

}

}

//---------------------------------------------------------------------------

void __fastcall TForm1::FormShow(TObject *Sender)

{

Image1->Visible=False;

Edit1->Clear();

Edit2->Clear();

RadioButton1->Checked=false;

RadioButton2->Checked=false;

Label3->Caption="";

}

//---------------------------------------------------------------------------

void __fastcall TForm1::Button1Click(TObject *Sender)

{

if((!Edit1==NULL)&&(!Edit1==NULL))

{

num= StrToFloat(Edit2->Text)/ (StrToFloat(Edit1->Text)* StrToFloat(Edit1->Text));

if((RadioButton1->Checked==true)&&(num<20.7))

{

Label3->Caption="imc= " + FloatToStrF(num, ffFixed, 6, 2) + " condição: Abaixo do Peso";

Label3->Color=clWhite;

//ShowMessage(num);

}

else if((RadioButton1->Checked==true)&&(num>=20.7)&&(num<26.4))

{

Label3->Caption="imc= " + FloatToStrF(num, ffFixed, 6, 2) + " condição: No Peso Normal";

Label3->Color=clLime;//clGreen;

//ShowMessage(num);

}

else if((RadioButton1->Checked==true)&&(num>=26.4)&&(num<27.8))

{

Label3->Caption="imc= " + FloatToStrF(num, ffFixed, 6, 2) + " condição: Um Pouco Acima do Peso";

Label3->Color=clYellow;

//ShowMessage(num);

}

else if((RadioButton1->Checked==true)&&(num>=27.8)&&(num<31.1))

{

Label3->Caption="imc= " + FloatToStrF(num, ffFixed, 6, 2) + " condição: Acima do Peso";

Label3->Color=clRed;

//ShowMessage(num);

}//---------------------------------------------------------------------

else if((RadioButton2->Checked==true)&&(num<19.1))

{

Label3->Caption="imc= " + FloatToStrF(num, ffFixed, 6, 2) + " condição: Abaixo do Peso";

Label3->Color=clWhite;

...

Baixar como (para membros premium)  txt (4.1 Kb)   pdf (49.1 Kb)   docx (12.4 Kb)  
Continuar por mais 1 página »
Disponível apenas no TrabalhosGratuitos.com