回 帖 发 新 帖 刷新版面

主题:[讨论]一道美国大学的FORTRAN试题

Using marker controlled loop to process several data items. Input / output redirection. The program description for this assignment is basically the same. The few changes are as followes.
1. The number of packets is not provided. Input will contain the weights of several packages, one per line. The end will be marked by a negative entry, not to be processed.
2. There will be no prompts to enter the data. The user knows what to enter.
3. The output for the packets will look like a table, with column headings as shown below. The numbers in each column must line-up. Each cost must have a dollar sign before it.

Recall that the weights should be printed accurate to one decimal place, the cost to two places (as in normal life)
Specifically the result will be printed as follows. There will be one blank line before and one after the result.

Weight    Cost
                <-- blank line
... ...                 ...        <--- one output line for each wight entered
            <-- blank line
----------------------
            <--- blank line ...    
... packets processed
 ... rejected 
... accepted 
Total weight shipped: ... lbs 
Total cost: $ ....
                             <-- blank line

回复列表 (共1个回复)

沙发

这个题目之前应该有一个例程的吧, 下面罗列的3点只是changes.
我觉得这个只是作业题不算试题.

我来回复

您尚未登录,请登录后再回复。点此登录或注册