Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

CSE1222 Programming & Algorithms for Engineers Autumn 2017 Programming Assignment 5: Putting it all together 1 Setting up the Programming Environment 1. Create a new

image text in transcribed
image text in transcribed
CSE1222 Programming & Algorithms for Engineers Autumn 2017 Programming Assignment 5: Putting it all together 1 Setting up the Programming Environment 1. Create a new directory (folder) called hu5 and move to that directory 2. Copy the file subtraction solution.exe from the directory /class/cse1222/34465/hu5 into the current directory. Copy the file subtraction template.cpp and rename it subtraction.cpp using the following command: cp /class/cse1222/34465/hu5/subtraction template.cpp subtraction.cpp 2 Work by Yourselif All lab and programming assignments are to be done by yourself. You may discuss labs or assignments with other students in the class but DO NOT LOOK AT ANYONE'S CODE OTHER THAN YOUR OWN. Needless to say, you should not share code. or copy anyone elses 3 Program Requirement:s Effective comming and tabbing will affect your grade. The "style" of your program should follow the style of the sample programs in the course notes. Your program should have the file name, your name, creation and last modification dates and a brief description of the program in the comments at the top of the program. The declaration of every variable should have a comment. You will use functions in your program Write a program for playing a variation of the Subtraction game called the game of NIM Our version of the game starts with up to 15 rods and up to 10 objects in each rod. Two players take turns removing objects from the rods. On a player's turn, she chooses a rod and removes one or more objects from that rod. She can remove all objects from the rod. The player who takes the last object from the rods (so that all rods are empty) wins. Run the solution subtract solution.exe to play the game. Your program must produce exactly the same output as this solution DO NOT delete the code already given to you in the code template. You must use the code given to you in the template in your solution. The algorith for the game is provided below. Most steps in the algorithm should be implemented as function calls. You need to implement the algorithm and the functions as described below. You may implement additional functions to help you in writing your solution. Though, in order to receive full

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_step_2

Step: 3

blur-text-image_step3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

1. Define and explain culture and its impact on your communication

Answered: 1 week ago