編程中structured English如何寫才不丟分

01、最近有同學問我structured English該如何寫(xie) ,針對問的點集中回答一下。

structured English的確不好寫(xie) ,首先書(shu) 上能找到的內(nei) 容非常少,它又不像編程語言那樣有嚴(yan) 謹的規範,對於(yu) 我們(men) 這些丁是丁卯是卯的理科生來說真的不好把握。

我們(men) 先來看看大綱對structured English的要求:

編程中structured English如何寫(xie) 才不丟(diu) 分

大綱要求我們(men) 要會(hui) 從(cong) structured English裏寫(xie) 出偽(wei) 代碼,沒有明確規定要會(hui) 寫(xie) structured English,但是看到紅框圈出來的字,上麵要求我們(men) 要學會(hui) 寫(xie) stepwise refinement,就是把大問題分解成若幹個(ge) 小問題,也就是用描述的方式進行分解,再下一句就是logic statements to define parts of an algorithm solution,還是需要寫(xie) structured English的。

在9618近4年的真題裏,有一道題明確要求寫(xie) structured English。

02、再看書(shu) 上對它的描述

編程中structured English如何寫(xie) 才不丟(diu) 分

總而言之就是要用英文句子寫(xie) 算法。

書(shu) 上提供的寫(xie) 法建議如下:

編程中structured English如何寫(xie) 才不丟(diu) 分

但是我們(men) 還是沒有直觀的感受。

根據曆年真題所有出現的關(guan) 於(yu) structured English的題目,我們(men) 總結了如下書(shu) 寫(xie) 方法:

structured English書(shu) 寫(xie) 方法

1 列舉(ju) 所用到到變量,該初始化需要初始化Initialise(這一步很多人容易忘記)

2 列出數據結構(需要數組還是record ,還是文件)

3 確定程序結構

循環repeat from step ……

選擇結構

順序結構

如果是文件,需要描述打開、讀取和關(guan) 閉文件

4 描述操作,如對比,賦值Set to,存儲(chu)

特別注意“prompt”,就是題目要求在寫(xie) 代碼時需要提醒用戶的信息

對照以上四步,基本一道題就沒有扣分的點了。

以上是寫(xie) structure English的四要點,最近和許同學交流,發現他在備考中自己總結的細節非常好,在征求他同意後和大家分享:

//

The techniques of structured English

例如你要用while循環可以這麽(me) 說

set a conditional loop, repeating until 條件達成

如果要用for循環則不一樣

set a counted-controlled loopto iterate through 對象

打開文件

open file in read/write/append mode

關(guan) 閉文件

直接就是close the file

給變量賦值:

加:calculate the new value of C by adding A to B

減:calculate the new value of C by subtracting A from B

乘:calculate the new value of C by multiplying A by B

除:calculate the new value of C by dividing A by B

1.連接兩(liang) 個(ge) string

obtainthe new string by concatenating A with B

assign the new string to Variable

2.初始化

initialize A to B

if就照常寫(xie) 就好了

基本思路就是先寫(xie) 個(ge) 偽(wei) 代碼的草稿在旁邊然後

按著步驟一步步來,但可以分為(wei) 幾個(ge) 大部分

1.declare 所有需要的variable或數據結構之類的

2. 按照上麵所給的語言翻譯從(cong) 偽(wei) 代碼翻譯過來就好了(如果過程出現function的使用的話,就寫(xie) use the function to obtain __然後加個(ge) 小括號寫(xie) 出那個(ge) function 。eg use the function(INT()) to obtain the value of the whole number part of the digit

3.如果有end while,next i,啥的,一定要記得加after the loop(這會(hui) 單獨算作一點)

4. 所有ADTS的description在p2的背記資料上都有,有一點使用free list的在我的錯題本上,這個(ge) 直接背下來考試直接謄寫(xie) 上去然後就好了。

5.有時候有的題目還得你結合考題本身的內(nei) 容,隻要在描述時扯上點邊就好了

真題演練時間

編程中structured English如何寫(xie) 才不丟(diu) 分

拿起筆來試試吧,參考答案如下:

編程中structured English如何寫(xie) 才不丟(diu) 分

【競賽報名/項目谘詢+微信:mollywei007】

上一篇

2025Fall英本TOP院校新增專業匯總!

你也可能喜歡

  • 暫無相關文章!

評論已經被關(guan) 閉。

插入圖片
返回頂部