Draw flowchart, write an algorithm and program in visual basic to input the units in foot and convert it into meter, inches, centimeters and millimeters. Form should be designed in such a way that all the controls should be located centrally is every size of the form. Meter=foot*0.305 Inch=foot*12 Centimeter=foot*30.48 Millimeter=foot*304.8 From should be designed in such a way that all the controls should be located centrally in every size of the form.
Ans:
Dim f As Single Logic for Calculation Part Private Sub cmdCalculate_Click() f = CSng(txtFoot.Text) txtMtr.Text = CStr(f * 0.305) txtlnch.Text = CStr(f * 12) txtCenti.Text = CStr(f * 30.48) txtMilli.Text = CStr(f * 304.8)
End Sub'Logic To Clear the text boxes Private Sub cmdClear_Click() txtFoot.Text = Clear txtlnch.Text = Clear txtMilli.Text = Clear txtMtr.Text = Clear txtCenti.Text = Clear
End Sub
No comments:
Post a Comment