Esercitazione 4 1) Simulate 6000 rolls of a dice and print the number of 1’s, 2’s, 3’s, etc. rolled. This should be roughly 1000 of each. (Dice.cpp) ./Dice Face Frequency 1 980 2 993 3 1030 4 1009 5 1002 6 986 2) Write a program which evaluate the Fibonacci serie using a recursive function. (fibonacci.cpp) ./fibonacci Enter an integer: 0 Fibonacci(0) = 0 Enter an integer: 1 Fibonacci(1) = 1 Enter an integer: 2 Fibonacci(2) = 1 Enter an integer: 3 Fibonacci(3) = 2 3) Write a program that calculates the circumference and area of a circle. The input from keyboard is the radius. Use two functions, one to calculate the area and the other one to calculate the circumference of the circle. The two functions have to be implemented in an external macro (cerchio.{h,cpp}) and called in an external program (useCerchio.cpp) 4) Write a macro where the function min(a,b) and min(a,b,c) are overloaded. The argument of the function can be passed by keyboard with the cin operator. 5) Repeat the exercise passing the argument from the command line. ./min Insert how many numbers you want to compare 2 Insert the first number: 3 Insert the second number: 6 The minimum is: 3 ./minArg 3 3 4 6 Min(3,4,6): 3 6) Write and test the computeTriangle() function that returns the area a and the perimeter p of a triangle with given size x,y and z: void computeTriangle(float & a, float &p, float x, float y, float z) To compute the area use Heron’s formula ./main Enter the sides: 2 3 5 The perimeter of the triangle is : 10 and its area is: 5