Exercises Homework 11. Algorithmisation Practice #3 Ján Dugáček February 3, 2019 Ján Dugáček 11. Algorithmisation Practice #3 Exercises Homework Table of Contents 1 Exercises 2 Homework Ján Dugáček 11. Algorithmisation Practice #3 Exercises Homework Exercises 1 Write a program that computes an approximation of π using whatever method 2 Write a function that returns all values and positions of inflection points of a vector that represents a function 3 Write a find and replace program that affects all files supplied as arguments Ján Dugáček 11. Algorithmisation Practice #3 Exercises Homework Advanced Exercises 1 Write a function that reads a C++ source code file and renames a method (leaving other methods of other classes with the same name alone) 2 Write a function that generates random nonsense that looks like C++ code Ján Dugáček 11. Algorithmisation Practice #3 Exercises Homework Exercises #2 1 Write a function that computes sine using Taylor’s series up to third element, compare its speed and precision to the sine function in cmath 2 Write a program that reads a file and writes down everything that was written in brackets inside the file (brackets can be in brackets too, but they are always ended properly) 3 Write a convenience function that gets two vectors of same size and returns a vector of pairs Ján Dugáček 11. Algorithmisation Practice #3 Exercises Homework Homework Write a program that indents a C++ source code file, using curly braces to determine the depth You have two weeks to do it Challenge for the Advanced: use also if, while and for controllers to indent the next line Ján Dugáček 11. Algorithmisation Practice #3