Skip to content

LehighISECourses/ISE407-Assignment-0

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Assignment 0

This is Assignment 0 in the Course ISE 407 "Computation Methods in Optimization" at Lehigh University. This assignment is meant to get started with Github Classroom, automated testing with Girhub Actions, Makefiles, Julia, C, and Python.

The example project here is written in C, and tested with make and bash scripts. Currently, if you run the tests, they will fail because the C code actually prints out the wrong thing.

The assignment

  • Modify the C code so that it outputs the correct string when run with no arguments.

  • Implement similar "Hello, World!" programs in Python and Julia and use the appropriate testing frameworks to check the output (In Julia, it is the Test package, in Python, you probably want pytest).

  • Modify all three codes so that they take an optional argument --sum followed by a list of integers and returns their sum. In Python and Julia, there are packages for making the addition of command-line parameters easy (both called ArgParse). They could be overkill for this assignment, but will be useful in the future.

  • Add appropriate tests for ensuring that your code returns the correct sum.

Test command

The command that will be run in the automated testing is make test, so ensure that you have that target in your Makefile (currently, it is there, and that it runs all necessary tests. I would suggest creating separate targets for the tests for each language and then making the overall test target depend on the language-specific targets, such as

test: c-test julia-test python-test

c-test: hello
...

Notes

  • gcc is hard-coded as the C compiler in the Makefile, since this is the default compiler on Ubuntu Linux. If you are on OS X, you may want to either install gcc with homebrew or modify the Maekfile so that clang can also be used. Just make sure that gcc is used when you check in the code so that the testing work.

Acknowledgement

Inspired by https://github.com/education/autograding-example-c

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published