填空題

本程序根據(jù)用戶選擇的運算符對輸入的二個操作數(shù)進行運算,并顯示運算結果。設計界面和運行界面如圖所示。其中,運算符是一個含有4個單選按紐的RadioGroup1對象。
 

下面是單擊“運算”按鈕的事件處理程序,請根據(jù)功能要求完成程序填空。

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
題目列表

你可能感興趣的試題

微信掃碼免費搜題