|
想请教大家一下这几个问题要如何答。谢谢。
1a.explain the differences and the relationship among there algorithm,program and pseudocode.
1c.design an algorithm by using both the pseudocode and flowchart to find the largest number in an (unsorted) list of number.In the proposed algorithm,which part of the algorithm may need the basic construct of sequence,iteration and selection.
谢谢大家的帮忙。因为我是读part time 的,而且是第一次读这个,所以不是很清楚。 |
|
|
|
|
|
|
|
发表于 19-2-2008 06:27 PM
|
显示全部楼层
功课也要人帮?
1. algorithm = 算法
2. program = 程式
3. pseudocode = 原始码
到Google找下, what is algorithm, what is program, what is pseudocode.
第二题:答案差不多是这样,到Google找下。
#include <iostream.h>
void main ()
{
int number,max=0; //number hold the input, max holds the largest number
cout<<"This program tells you the largest number among the 10 integers entered."<<endl;
cout<<"Please enter one integer per line..."<<endl<<endl;
for(int count=1;count<=10;count++)
{
cout<<"Number: ";
cin>>number;
if (number >= max)
max= number;
}
cout<<endl<<"The largest number is "<<max<<endl;
cout<<endl;
} |
|
|
|
|
|
|
| |
本周最热论坛帖子
|