h0nda
What is folding?
estou a fazer um pequeno programa no qual se calcula áreas e perímetros, mas estou com um problema
PROBLEMA:
quando eu selecciono área e perímetro, o programa só me dá o perímetro. quando selecciono os 3, só me dá a ultima opção.
INTERFACE:
CODIGO:
gostava de ter uma ajudita.
Obrigado ; )
PROBLEMA:
quando eu selecciono área e perímetro, o programa só me dá o perímetro. quando selecciono os 3, só me dá a ultima opção.
INTERFACE:
CODIGO:
Código:
void CResolucaoDlg::OnButton2()
{
CString CS1, CS2;
CString CSresult;
double n1, n2, result;
float hip;
char str[20];
if (m_tri.GetCheck()==BST_CHECKED){
if (m_area.GetCheck()==BST_CHECKED){
m_comp.GetWindowText (CS1);
m_larg.GetWindowText (CS2);
n1 = atof (CS1);
n2 = atof (CS2);
result = n1 * n2;
_gcvt (result, 10, str);
CSresult = str;
m_result.SetWindowText (CSresult);
}
if (m_perim.GetCheck()==BST_CHECKED){
m_comp.GetWindowText (CS1);
m_larg.GetWindowText (CS2);
n1 = atof (CS1);
n2 = atof (CS2);
result = 2*n1 + 2*n2;
_gcvt (result, 10, str);
CSresult = str;
m_result.SetWindowText (CSresult);
}
if (m_hip.GetCheck()==BST_CHECKED){
m_comp.GetWindowText (CS1);
m_larg.GetWindowText (CS2);
n1 = atof (CS1);
n2 = atof (CS2);
result = sqrt((n1*n1)+(n2*n2));
_gcvt (result, 10, str);
CSresult = str;
m_result.SetWindowText (CSresult);
}
}
if (m_rect.GetCheck()==BST_CHECKED){
if (m_area.GetCheck()==BST_CHECKED){
m_comp.GetWindowText (CS1);
m_larg.GetWindowText (CS2);
n1 = atof (CS1);
n2 = atof (CS2);
result = n1 * n2 / 2;
_gcvt (result, 10, str);
CSresult = str;
m_result.SetWindowText (CSresult);
}
if (m_perim.GetCheck()==BST_CHECKED){
m_comp.GetWindowText (CS1);
m_larg.GetWindowText (CS2);
n1 = atof (CS1);
n2 = atof (CS2);
hip = sqrt((n1*n1)+(n2*n2));
result = n1 + n2 + hip;
_gcvt (result, 10, str);
CSresult = str;
m_result.SetWindowText (CSresult);
}
if (m_hip.GetCheck()==BST_CHECKED){
m_comp.GetWindowText (CS1);
m_larg.GetWindowText (CS2);
n1 = atof (CS1);
n2 = atof (CS2);
result = sqrt((n1*n1)+(n2*n2));
_gcvt (result, 10, str);
CSresult = str;
m_result.SetWindowText (CSresult);
}
}
}
gostava de ter uma ajudita.
Obrigado ; )
Última edição: