Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Programming Language Expert

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 http://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.

Programming Language, Programming

  • Category:- Programming Language
  • Reference No.:- M92044941

Have any Question?


Related Questions in Programming Language

Assignment - horse race meetingthe assignment will assess

Assignment - Horse Race Meeting The Assignment will assess competencies for ICTPRG524 Develop high level object-oriented class specifications. Summary The assignment is to design the classes that are necessary for the ad ...

Overviewthis tasks provides you an opportunity to get

Overview This tasks provides you an opportunity to get feedback on your Learning Summary Report. The Learning Summary Report outlines how the work you have completed demonstrates that you have met all of the unit's learn ...

Background informationthis assignment tests your

Background Information This assignment tests your understanding of and ability to apply the programming concepts we have covered throughout the unit. The concepts covered in the second half of the unit build upon the fun ...

Structs and enumsoverviewin this task you will create a

Structs and Enums Overview In this task you will create a knight database to help Camelot keep track of all of their knights. Instructions Lets get started. 1. What the topic 5 videos, these will guide you through buildi ...

Question 1 what is a computer program what is structured

Question: 1. What is a Computer program? What is structured programming? 2. What is modular programming? Why we use it? 3. Please evaluate Sin (x) by infinite series. Then write an algorithm to implement it with up to th ...

1 write a function named check that has three parameters

1. Write a function named check () that has three parameters. The first parameter should accept an integer number, andthe second and third parameters should accept a double-precision number. The function body should just ...

Assignmentquestion onegiving the following code snippet

Assignment Question One Giving the following code snippet. What kind of errors you will get and how can you correct it. A. public class HelloJava { public static void main(String args[]) { int x=10; int y=2; System.out.p ...

Task arrays and structsoverviewin this task you will

Task: Arrays and Structs Overview In this task you will continue to work on the knight database to help Camelot keep track of all of their knights. We can now add a kingdom struct to help work with and manage all of the ...

Question - create a microsoft word macro using vba visual

Question - Create a Microsoft Word macro using VBA (Visual Basic for Applications). Name the macro "highlight." The macro should highlight every third line of text in a document. (Imagine creating highlighting that will ...

Assignment - haskell program for regular expression

Assignment - Haskell Program for Regular Expression Matching Your assignment is to modify the slowgrep.hs Haskell program presented in class and the online notes, according to the instructions below. You may carry out th ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As