c语言编程代写 Exam assignment framework

Exam assignment framework in imperative programming

c语言编程代写 The game rounds are completed in a fixed order: the first time you roll the dice after the 1s. Next time after the 2s.

The general rules for the preparation and submission of the assignment are described in the Framework for Exam assignments in Imperative Programming.

 

This task is to program a Yatzy-like game. The starting point is the classic Yatzy rules. The Yatzy game in this task is special in the following ways:  c语言编程代写

 

More than five dice can be used (let's say here that N dice are played).

The game can be played without dialogue with the users (perhaps except prompt for N).

In each round, the N dice are rolled only once.

The game rounds are completed in a fixed order: the first time you roll the dice after the 1s. Next time after the 2s. Last time it's about achieving yatzy.

In each round, the program selects up to 5 out of the N dice that give the highest possible number of points in the current round.

Thus, N dice are rolled at a time, N ≥ 5. The program selects up to 5 of these, which can be used in the current game. The non-selected dice are ignored.

 

Example with 8 dice showing 2 2 6 5 1 6 2 3:  c语言编程代写

 

In a round where you fight for 1s. There is only one 1s and 1 point is posted on the first row.

In a round where 2s are fought for. Since there are three 2s, these are selected and 6 points are posted in the 2nd row.

In a round where two pairs are fought. Since there are two 6s and two 2s, these are selected and 16 pairs are posted in a row.

In a round where fighting is by chance. The 5 highest dice rolls are selected and 22 are posted.

You can choose to enforce that you must have at least three identical dice to get points in rows 1-6.  c语言编程代写

 

The game must have a table (score board), which keeps track of the points account (for one player, namely the computer). This table can be a simple, statically allocated int array. When the last round is completed, the game result is calculated according to the current rules, including the bonus rule, a summary of the game is printed on the screen, and the user is offered, iteratively, another game.

 

It is recommended that the eyes of the N dice be printed continuously after each round, together with the number of points that the round gives rise to. In this way, it is possible to check that the points of the game are calculated correctly in each round.

 

In this game there is a need for a simulation of a dice. This can be easily achieved through a function that uses the edge function from stdlib. (We have already seen such a dice roll feature). As part of the solution, a function roll_multiple_dies is used, which creates an int array and shows N simultaneous dice rolls. We have already programmed roll_multiple_dies in an assignment on courses

 

命令式编程中的考试作业框架  c语言编程代写

本文档描述了命令式编程中的考试作业框架。

考试作业的目的是为口语考试创建个人起点。其目的还在于通过构建比课程练习中使用的程序更大的程序来促进学生对命令式编程的理解。

口试将作为关于已提交课程的对话进行,并在此之后进行与课程目标相关的考试。考试成绩是根据当前课程中规定的目标描述和评估标准来评估的。评估是根据口试中提供的印象进行的,部分通过对提交的课程的讨论,部分通过课程大纲中的考试。

以下规则适用:


  • 该程序必须单独准备。

  • 程序必须用C 编写。用 ANSI C89 (C90) 编写程序是最自然的。如果您选择用另一种 C 变体编写程序,您必须能够解释所选 C 变体与 ANSI C89 之间的差异。

  • 源程序通过互联网以电子方式提交,与课程作业相同。出于实际原因,提交的程序必须具有一个C 源文件的形式。在程序注释中,在源文件的顶部,输入您的全名、电子邮件地址、组和研究领域(计算机科学/软件/交互设计)。

  • 必须说明和描述来自同学的帮助、互联网上的资源以及直接影响提交的程序的类似内容。在程序注释中、在带有您姓名的注释下方等中说明这一点。

可以对变量和函数使用丹麦语名称。但是,像在 C 编程中一样,避免在变量名和函数名中使用丹麦字母(æ、ø、å、Æ、Ø 和 Å)。

在评估您的计划时,重点将放在以下特征上:  c语言编程代写


  • 可读性和可理解性,包括良好清晰的程序结构(缩进等)以及程序注释的适当使用(参见课程中的教学和讨论)。

  • 变量、参数和函数的良好命名反映了名称在程序中的作用。

  • 由于通过逐步细化自上而下的编程,将问题解决很好地分解为适当数量的简短而清晰的功能。

  • 函数的良好参数化,以便函数的所有输入都通过输入参数进行,并且函数的输出通过返回值或输出参数传达。

  • 缺少全局变量。

  • 选择合适的数据结构(结构和数组)。这主要与最后两个考试作业相关。

  • 适当使用C 标准库中的功能。

c语言编程代写

留学文书代做

更多代写:cs代写    经济代考  会计代写      计算机科学代写  英文简历代写

发表回复

客服一号:点击这里给我发消息
客服二号:点击这里给我发消息
微信客服1:essay-kathrine
微信客服2:essay-gloria