Assignment 1 Solution

$29.99 $18.99

For this assignment, you will be writing two command-line utilities: a simple game of life and a program that counts member references in other programs. Both programs will require that you use command-line arguments. The first also requires that you use arrays and the second requires that you process standard input (using scanf). Please remember…

You’ll get a: . zip file solution

 

 
Categorys:
Tags:

Description

Rate this product

For this assignment, you will be writing two command-line utilities: a simple game of life and a program that counts member references in other programs. Both programs will require that you use command-line arguments. The first also requires that you use arrays and the second requires that you process standard input (using scanf).

Please remember that we are using testing scripts to evaluate your work. As a result, it’s very important that (a) all of your files are named correctly and located in the specified locations in your repository and (b) the output of your programs match the expected output precisely.

Follow the instructions carefully, so that we receive your work correctly.

Your first step should be to log into MarkUs (https://markus.cdf.toronto.edu/csc209-2019-01/) and navigate to the a1: Intro C assignment. Like for the labs, this triggers the starter code for this assignment to be committed to your repository. You will be working alone on this assignment, and the URL for your Git repository can be found on the right hand side of the page.

Pull your git repository. There should be a new folder named a1. All of your code for this assignment should be located in this folder. Starter code, including a Makefile that will compile your code and provide a sanity check, has already been placed in this folder. To use the Makefile, type “make test_life“, “make test_trim“, or “make test_trcount“. That will compile the corresponding program and run our sanity checks. To remove .o files and the executable, type “make clean“.

Once you have pushed files to your repository, you can use MarkUs to verify that what you intended to submit was actually submitted. The Submissions tab for the assignment will show you what is in the repository, and will let you know if you named the files correctly.

You will write a C program called life.c that is implements a 1D variant of the Game of Life (https://en.wikipedia.org/wiki/Conway%27s_Game_of_Life) called Rule 90 (https://en.wikipedia.org/wiki/Rule_90) . You’ll also write two helper functions in life_helpers.c.

Your program reads two command line arguments, the first represents the initial state and the second represents the number of states to print. Your program will then print the number of states specified, one per line, starting

with the initial state. For example, given the initial state and 10 states, the program

would print:

……X…….X…….X……

Assignment 1 https://q.utoronto.ca/courses/68725/assignments/113145

Assignment 1 https://q.utoronto.ca/courses/68725/assignments/113145

5页 共5 2019/3/23 14:04