Software Development!!!!!!!!!!!!!!!!!!!!!! Any Expert???????

2007-02-27 3:46 am
I have some pseudocode:
topsales = 0
Enter sales period(Salesperson)
Open file
While not end of file
Read sales record from file
If salesperson matches sales period for record Then
If totalsales in record > topsales Then
topsales = total sales in record
End if
End if
End while
Close file
Display top sales record

Can anybody convert to program style????????????
Please.

回答 (1)

2007-02-27 7:34 am
✔ 最佳答案
其實, 我唔係好明你要 search o既係唔係某個人在某個時段內最高的銷售額, 定係其他...
所以我就依「某個人在某個時段內最高的銷售額」呢個 concept 隨意寫o左段 program style o既 code... (有 $ o既係 variable.)

$topsales=0;

$input=getinput();
$salesperiod=getperiod($input);
$salesperson=getperson($input);

$fp=fileopen($file);
while($fp<>EOF){
 $record=getrecord($fp);
 $person=getperson($record);
 $period=getperiod($record);
 if($person==$salesperson && $period==$salesperiod){
  $totalsales=gettotalsales($sales_record);
  if($totalsales>$topsales){
   $topsales=$totalsales;
  }
 }
}
fileclose($file);
display($salesperiod,$salesperson,$topsales);

2007-02-26 23:36:45 補充:
sorry, 開頭應該改為以下, 因為 function name 撞o左...$topsales=0;$input=getinput();$salesperiod=getinputperiod($input);$salesperson=getinputperson($input);....


收錄日期: 2021-05-03 05:46:08
原文連結 [永久失效]:
https://hk.answers.yahoo.com/question/index?qid=20070226000051KK04069

檢視 Wayback Machine 備份