Compare and evaluate procedural programming languages

Assignment Help Programming Languages
Reference no: EM131290265

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.

Reference no: EM131290265

Questions Cloud

Describe h-ds competitive advantage in global markets : Describe H-D's competitive advantage in Global Markets. Determine and explain entry strategies for global expansion. Organizational Design: As you have been completing the Strategic Business.
Complete the table and also write a narrative paragraph : Complete the table and also write a narrative paragraph.- Responses should be in narrative paragraph form and should have a clear.
How much may tracy claim as itemized deductions : Tracy is single and had an adjusted gross income of $ 33,400 in 2015. Tracy also has the following items : unreimbursed medical expenses $ 3,909, state income tax $1869, interest expense first mortgage $ 3625, interest expense second mortgage $ 1236,..
Describe the different forms of cocaine and amphetamines : describe the different forms of cocaine and amphetamines.brief discussion of some of the treatment options for individuals with cocaine and amphetamine addictions.
Compare and evaluate procedural programming languages : 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.
What is the expected stock-price effect : A publicly traded firm announces an increase in its dividend, with no other material information accompanying the announcement. What information is this announcement likely to convey, and what is the expected stock-price effect, as the market assi..
What is a view-based access control in database : What is a View-based access control in database? What is a Data warehouse? What is Online Transaction Processing (OLTP)?
Re-write the given journal entries : Re-write the Given Journal Entries
How is process selection related to product design : How is process selection related to product design and capacity determination? Your initial post should be 200-250 words.

Reviews

len1290265

11/25/2016 4:33:23 AM

Discussion of loop mechanisms – 10marks 9-10 A full discussion of all features of the loops used in the program, including an insightful evaluation of the two mechanisms leading to a well-reasoned comparison. 7-8 A discussion of all features of the loops used in the program. Some useful comparisons have been drawn, showing a reflective comparison of the two languages. 5-6 Most features of the loop mechanisms have been discussed. The student has made some attempt to discuss relative merits, but without much insight. 3-4 An incomplete discussion of the differences between the loop mechanisms, or the student has made no real attempt to compare the two. 1-2 Some differences between the loop mechanisms are stated, but without much discussion. 0 Discussion was not submitted or contains very little useful information.

len1290265

11/25/2016 4:33:15 AM

Program in other language - 5 marks 5 A program that completely implements the description above. There are no errors in the program. The user is given appropriate information and guidance. 4 A complete program that has only minor errors. Some user guidance may be incomplete. 3 The program allows the user to play the game, but features specified in the description above are missing. User interaction may be unhelpful. 2 A working program that partially implements the description above, but has significant omissions. User interaction may be obstructive. 1 The program is incomplete, but contains useful code that could be developed to a working program. 0 Program is not submitted or contains little useful code.

len1290265

11/25/2016 4:32:57 AM

C++ program - 5 marks 5 A program that completely implements the description above and follows the style rules used in the module. There are no errors in the program. The user is given appropriate information and guidance. 4 A complete program that has only minor errors or deviation from the style rules. Some user guidance may be incomplete. 3 The program allows the user to play the game, but features specified in the description above are missing. There may be errors in the code style and user interaction may be unhelpful. 2 A working program that partially implements the description above, but has significant omissions. There may be serious deviations from the code style or user interaction may be obstructive. 1 The program is incomplete, but contains useful code that could be developed to a working program. 0 Program is not submitted or contains little useful code.

Write a Review

Programming Languages Questions & Answers

  Write a haskell program to calculates a balanced partition

Write a program in Haskell which calculates a balanced partition of N items where each item has a value between 0 and K such that the difference b/w the sum of the values of first partition,

  Create an application to run in the amazon ec2 service

In this project you will create an application to run in the Amazon EC2 service and you will also create a client that can run on local machine and access your application.

  Explain the process to develop a web page locally

Explain the process to develop a Web page locally

  Write functions

These 14 questions covers java class, Array, link list , generic class.

  Programming assignment

If the user wants to read the input from a file, then the output will also go into a different file . If the user wants to read the input interactively, then the output will go to the screen .

  Write a prolog program using swi proglog

Write a Prolog program using swi proglog

  Create a custom application using eclipse

Create a custom Application Using Eclipse Android Development

  Create a application using the mvc architecture

create a application using the MVC architecture. No scripting elements are allowed in JSP pages.

  Develops bespoke solutions for the rubber industry

Develops bespoke solutions for the rubber industry

  Design a program that models the worms behavior

Design a program that models the worm's behavior.

  Writing a class

Build a class for a type called Fraction

  Design a program that assigns seats on an airplane

Write a program that allows an instructor to keep a grade book and also design and implement a program that assigns seats on an airplane.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd