【问题标题】:How to write a pseudo Code [closed]如何编写伪代码[关闭]
【发布时间】:2010-10-14 08:47:30
【问题描述】:

使用 VB.net、C# 和 SQL Server

我想为我的应用程序编写一个伪代码。

伪代码就像编码或流程图......?

任何人都可以为任何类型的应用程序提供示例伪代码吗?

【问题讨论】:

  • 为什么需要这个伪代码?你怎么能有这些标签来回答你的问题?
  • 什么.......?你知道什么是伪代码吗?我希望您不要认为这是 .NET 的功能或其他什么的......
  • 我猜你真正的问题是“什么是伪代码?”。

标签: c# asp.net sql-server vb.net


【解决方案1】:

这是一个编写伪代码的算法:

用你自己的话写

【讨论】:

    【解决方案2】:

    伪代码只是表达程序意图的一种方式,语法上并不正确。

    一个例子可以是:

    print "What is your name"
    read input from user
    print "Hello " + user input
    

    另一个从 ATM 取款的例子:

    if the selected account's balance is greater than the requested amount
        reduce balance by requested amount
    else
        display error message
    end if
    

    【讨论】:

      【解决方案3】:

      我认为这会有所帮助:

      http://en.wikipedia.org/wiki/Pseudo-code

      特别是:

      伪代码语法没有标准 存在,因为伪代码中的程序是 不是可执行程序。伪代码 相似,但不应混淆 与,骨架程序包括 可以编译的伪代码 没有错误。流程图可以 被认为是一种图形替代品 到伪代码。

      【讨论】:

        【解决方案4】:

        伪代码应该是代码的自然语言等价物,例如:

        while there are items left to process
           process the current item
           remove the item from the collection
        

        【讨论】:

          猜你喜欢
          • 2010-11-29
          • 2010-10-25
          • 1970-01-01
          • 1970-01-01
          • 2012-01-24
          • 1970-01-01
          • 2014-05-29
          • 2014-02-05
          • 1970-01-01
          相关资源
          最近更新 更多