Demonstrate an understanding of the basic principles of


This assignment contributes to the assessment of the following learning outcomes:

- Demonstrate an understanding of the basic principles of procedural programming using an appropriate programming language, including the use of variables, conditions, loops, subprograms.
- Compare and evaluate procedural programming languages.

Task 1

You should write code to implement the program detailed below. You should implement this TWICE - once in C++ and once in another programming language. You may choose the other programming language from: Ruby, Perl, BASIC, Python, Javascript, Processingjs.

Task 2

You should write a short essay comparing the use of loops in the two programs you have created for task 1. You should discuss:

- Differences in the way that loops are used and written in the two languages.
- A discussion of which approach you feel is best, with reasons.

You should limit the discussion to the code you have written, so do not discuss any syntax that you have not used. If you use sources of information, you should reference them correctly. Please use https://www.citethemrightonline.com/ for information on how to reference sources.

The word limit for this essay is 455 words. You are allowed to go over the word limit by up to 10% without penalty. (So in this case, you can write up to 500 words). If you exceed this, the mark for this assignment will drop by 5%. (So if you got a mark of 75%, this would drop to 70%).

The program

Your program will allow the user to play a game of "Pennies" against the computer. The game starts with 20 pennies arranged in a row. Each player takes it in turn to remove between 1 and 5 pennies. The loser is the person who removes the final penny.
When running the game, the player can choose whether to make the first move, or ask the computer to.

When it is the player's turn, the player can choose between 1 and 5 pennies. The program should prevent the player from removing any other number of pennies.

When it is the computer's turn, the computer will remove a random number of pennies - from 1 to 5. The exception is when there are fewer than 7 pennies left. In this case, the computer should remove the correct number of pennies to win the game. The program should let the player know how many pennies were taken.

Before each turn, the program should display the number of pennies remaining, both as a number and by showing a line of circles to represent pennies. For example:

                Pennies remaining: 12      oooooooooooo

At the end of the game, the program should say who won. It should then allow the user to either play another game or quit the program. The program should keep track of how many times the player has won and how many times the player has lost. This should be displayed when the player chooses to quit the program.

Notes on code style

You are expected to follow the style guidelines for C++, which are available on Blackboard. If you don't follow the guidelines, this may affect your marks, as noted in the mark scheme below.

The style guide asks you to include comments at the top of your code. This would normally include your name. However, to allow for anonymous marking, please put only your student ID number.

The style rules may not apply to the other language that you are using. However, you code should be neat, well-structured and commented.

Request for Solution File

Ask an Expert for Answer!!
Programming Languages: Demonstrate an understanding of the basic principles of
Reference No:- TGS01692993

Expected delivery within 24 Hours