This is the archived website of SI 486H from the Spring 2016 semester. Feel free to browse around; you may also find more recent offerings at my teaching page.

Problem 17

Dice rolling programs

Due: January 26
Points: 2

Write a program three times, in C++, Java, and Python3, that simply outputs the result of rolling two dice and taking the sum. That is, your program should take no input or command-line arguments, and print a single integer between 2 and 12.

In each case, use the "best practices" or standards of that programming languages to generate the random dice rolls. This will be different in each language because of the different libraries available and so on.

Create a single Makefile that compiles all three programs, and that works in the CS department Linux lab environment.

Submit your program according to the instructions on the submit page.