试题详情
简答题 本程序根据用户选择的运算符对输入的二个操作数进行运算,并显示运算结果。设计界面和运行界面如图所示。其中,运算符是一个含有4个单选按纽的RadioGroup1对象。 下面是单击“运算”按钮的事件处理程序,请根据功能要求完成程序填空。 procedure TForm1.Button1Click(Sender: TObject);//运算  var     x1,x2,y :Integer;  begin     x1 := StrToInt( Edit1. ①); x2 : = StrToInt( Edit2. ②);     Case ③.ItemIndex of      0: y := x1 + x2 ;      1: y := x1 - x2;      2: y := x1 * x2;      3: y := x1 Div x2;     End;     Edit3. ④:= IntToStr( ⑤);  end;
  • ①text;②text;③RadioGroup1;④text;⑤y
  • 关注下方微信公众号,在线模考后查看

热门试题