CS 315
Homework 2


Assigned: April 16, 2018
Due: April 30, 2018, 23:59

Subprogram Parameters in Javascript, Python, PHP, C and C++

In this homework assignment you will investigate some of the issues related to the parameters in Javascript, Python, PHP, C, and C++ languages. The issues you will investigate are

First investigate how each of these issues are answered in each of these five programming languages. Then write simple programs clearly illustrating the design decisions for the issues in the languages. Discuss the results of execution of your programs. To help the TAs understand your code and give you good grades, appropriately comment your source to explain your example and why your example is appropriate for this homework.

Write a report that contains your sample programs, the results of compilations and executions, and your discussions on the results. Make sure you give a list of rerefences and proper citations to these references in your report about the design choices for these issues in the languages covered in this homework.

Notes

Make sure your programs execute on the dijkstra.cs.bilkent.edu.tr machine, since the TA will test your programs on this machine.

For C++, you need to investigate the variadic templates introduced in C++11. You need to be sure that you use a compiler that is at least capable of compiling C++11 extensions. On dijkstra, the default g++ installation is 4.8.5, and g++ 7.2.1 is installed as scl devtoolset-7. In short, you may enable g++ 7.2.1 by typing source scl_source enable devtoolset-7 at the terminal. You can refer to an example here.

You may use the tutorials as a reference, but do not derive your example programs from these tutorials. If you do so, your grade will be negatively affected.

Collaboration on the homework is not allowed.

Logistics

Place your example programs under different files each having your last name and name, and a description for the language used. For example, lastname_name_javascript.html, lastname_name_python.py, lastname_name_php.php (or lastname_name_php.html), lastname_name_c.c, lastname_name_cpp.cpp.

Put your report and example files into a folder named lastname_name and make a zip or rar of the folder. Then, e-mail this file to the TA, Gizem Çaylak < gizem.caylak@bilkent.edu.tr >.

Suggestion: Do not postpone the development and test of your programs to the last minute!. The dijkstra machine might be overloaded, then.