# CategoryC++

## animating an exponential function approximation [fltk]

Bjarne Stroustrup “Programming Principles and Practice Using C++” Chapter 15 – 15.5 Using GUI library called FLTK (Fast Light Tool Kit, “full tick”). Output: [code language=”cpp”] // Philipp Siedler // Bjarne Stroustrup’s PP // Chapter 15 15.5 #define _USE_MATH_DEFINES #include…

## graphing sine, cosine, their sum and the sum of their squares

Bjarne Stroustrup “Programming Principles and Practice Using C++” Chapter 15 Exercise 4 Output: [code language=”cpp”] // Philipp Siedler // Bjarne Stroustrup’s PP // Chapter 15 Exercise 4 #define _USE_MATH_DEFINES #include "Simple_window.h" #include "Graph.h" #include <cmath> // layout constexpr int xmax…

## function class object with reset and precision parameter

Bjarne Stroustrup “Programming Principles and Practice Using C++” Chapter 15 Exercise 3 [code language=”cpp”] // Philipp Siedler // Bjarne Stroustrup’s PP // Chapter 15 Exercise 3 #define _USE_MATH_DEFINES #include "Simple_window.h" #include "Graph.h" #include <cmath> typedef double Fct(double); double one(double x)…

## function class object with reset

Bjarne Stroustrup “Programming Principles and Practice Using C++” Chapter 15 Exercise 2 [code language=”cpp”] // Philipp Siedler // Bjarne Stroustrup’s PP // Chapter 15 Exercise 2 #define _USE_MATH_DEFINES #include "Simple_window.h" #include "Graph.h" #include <cmath> typedef double Fct(double); double one(double x)…

## factorial – recursive and iterative methods

Bjarne Stroustrup “Programming Principles and Practice Using C++” Chapter 15 Exercise 1 [code language=”cpp”] // Philipp Siedler // Bjarne Stroustrup’s PP // Chapter 15 Exercise 1 #include "std_lib_facilities.h" int fac_recursive(int n) { return n > 1 ? n * fac_recursive(n…

## simple structure – adding complex objects by input – class definition recap 9/9

Bjarne Stroustrup “Programming Principles and Practice Using C++” Chapter 15 Class Definition Drill 9 [code language=”cpp”] // Philipp Siedler // Bjarne Stroustrup’s PP // Chapter 15 Class Definition Drill 9 #include "std_lib_facilities.h" struct Person { Person(string first_name, string second_name, int…

## simple structure – adding objects by input – class definition recap 8/9

Bjarne Stroustrup “Programming Principles and Practice Using C++” Chapter 15 Class Definition Drill 8 [code language=”cpp”] // Philipp Siedler // Bjarne Stroustrup’s PP // Chapter 15 Class Definition Drill 8 #include "std_lib_facilities.h" struct Person { Person(string name, int age); Person()…

## simple structure – adding set methods – class definition recap 7/9

Bjarne Stroustrup “Programming Principles and Practice Using C++” Chapter 15 Class Definition Drill 7 [code language=”cpp”] // Philipp Siedler // Bjarne Stroustrup’s PP // Chapter 15 Class Definition Drill 7 #include "std_lib_facilities.h" struct Person { Person(string name, int age); Person()…

## simple structure – adding set methods – class definition recap 6/9

Bjarne Stroustrup “Programming Principles and Practice Using C++” Chapter 15 Class Definition Drill 6 [code language=”cpp”] // Philipp Siedler // Bjarne Stroustrup’s PP // Chapter 15 Class Definition Drill 6 #include "std_lib_facilities.h" struct Person { Person(string name, int age) :n(name),…

## simple structure – adding get methods – class definition recap 5/9

Bjarne Stroustrup “Programming Principles and Practice Using C++” Chapter 15 Class Definition Drill 5 [code language=”cpp”] // Philipp Siedler // Bjarne Stroustrup’s PP // Chapter 15 Class Definition Drill 5 #include "std_lib_facilities.h" struct Person { Person(string name, int age) :n(name),…

Physical Address

304 North Cardinal St.
Dorchester Center, MA 02124