Start code: code_session2.tar.gz
Download the start code, upack it and copy the top directory
examen_session2 in a new directory, named
You should develop your solutions in the new directory.
cd tar xzvf examen_session2.tar.gz cp -r examen_session2 examen_session2_YourFamilyName cd examen_session2_YouFamilyName
The given code in
readShape.cxx is buggy. Correct the compilation warnings, errors and the program behavior. The fixed program should open and read the provided data file up to its end without errors.
fourDigits program list all four digits numbers that fulfill the
following condition: If you split a four digits number into two parts each having two
digits and add the squares of these numbers, you get the original four digit number.
1233 = 12*12 + 33*33
Complete the three missing parts of the program. These missing parts are preceded with a comment
Complete the program
The program should then display the list of twin prime numbers below 100.
A twin prime is a prime number that is either 2 less or 2 more than another prime number.
(3, 5), (5, 7), (11, 13), (17, 19), (29, 31), (41, 43),…
When the program is completed, increase the number limit to get displayed all twin prime numbers below 1000.
In this task you get a class
Point and a C++ program
maximumDistance.cxx. Both the class and the program are completely implemented and working.
Point represents a geometrical point in two dimensions (x, y). Extend the class to represent a geometrical point in three dimensions (x, y, z) and adapt the
maximumDistance.cxx program to take into account this change.
Before you leave the room, check with the teachers that they received your code.
cd tar czvf examen_session2_YourFamilyName.tar.gz examen_session2_YourFamilyName