Assignment 3
Write a program called gcds.cpp to perform the task described in problem 5.4. The final version of the program should contain at least 2 functions: 1 function named gcd with two parameters that returns the gcd of its two parameters, and a function called main. The program gcds.cpp must be turned in by transferring it to your ftp directory for this class. Only the source code file should be turned in and it must be named gcds.cpp.
Write a program called twinprime.cpp to perform the task described in problem 5.6. The final version of the program should contain at least 2 functions: 1 function named prime which should be similar to the prime function discussed in class, and a function called main. The program twinprime.cpp must be turned in by transferring it to your ftp directory for this class. Only the source code file should be turned in and it must be named twinprime.cpp.
Write a program called craps.cpp to perform the task described in problem 5.17. You will need to include both the .h file and the .cpp file for the dice class in your project folder in order to write this program. Programs using the dice class are presented in your text and will be discussed in class after spring break. Oooops, you'll also need the .h file and the .cpp file for the randgen class (i.e., a class used to generate a random number); this class is used by the dice class. Be sure to include both .h files and both .cpp files in the project where you write the code for problem 5.17. The program craps.cpp must be turned in by transferring it to your ftp directory for this class. Only the source code file should be turned in and it must be named craps.cpp.
Note that 10% of your program grade is based on the readability of your program. This includes things like style, comments, and the naming of variables and functions. Make sure you include a comment at the top of each program with your name, course and purpose of the program specified.