# CategoryChapter 06 – Principles and Practice Using C++

## permutations and combinations

Bjarne Stroustrup “Programming Principles and Practice Using C++” Chapter 6 Exercise 10 Using std_lib_facilities.h by Bjarne Stroustrup. [code language=”cpp”] // Philipp Siedler // Bjarne Stroustrup’s PP // Chapter 6 Exercise 10 /* input: 12 3 c */ #include "std_lib_facilities.h" int factorial(int _n)…

## compose digits to integers

Bjarne Stroustrup “Programming Principles and Practice Using C++” Chapter 6 Exercise 9 Using std_lib_facilities.h by Bjarne Stroustrup. [code language=”cpp”] // Philipp Siedler // Bjarne Stroustrup’s PP // Chapter 6 Exercise 9 //input: 1234x #include "std_lib_facilities.h" class Token { public: char intChar; Token(char…

## bulls and cows [guess 4 characters]

Bjarne Stroustrup “Programming Principles and Practice Using C++” Chapter 6 Exercise 8 Using std_lib_facilities.h by Bjarne Stroustrup. [code language=”cpp”] // Philipp Siedler // Bjarne Stroustrup’s PP // Chapter 6 Exercise 8 #include "std_lib_facilities.h" vector<char> randomCharGen(int _seed, int _num) { vector <char> chosen;…

## grammar for bitwise logical expressions

Bjarne Stroustrup “Programming Principles and Practice Using C++” Chapter 6 Exercise 7 Using std_lib_facilities.h by Bjarne Stroustrup. [code language=”cpp”] // Philipp Siedler // Bjarne Stroustrup’s PP // Chapter 6 Exercise 7 #include "std_lib_facilities.h" /* Binary And: Exclusive Or And "&" Or Binary…

## using a simple class

Bjarne Stroustrup “Programming Principles and Practice Using C++” Chapter 6 Exercise 4 Using std_lib_facilities.h by Bjarne Stroustrup. [code language=”cpp”] // Philipp Siedler // Bjarne Stroustrup’s PP // Chapter 6 Exercise 4 #include "std_lib_facilities.h" class nameValue { public: nameValue(string n, int a) :…

Bjarne Stroustrup “Programming Principles and Practice Using C++”Chapter 6 Exercise 3Using std_lib_facilities.h by Bjarne Stroustrup. Code: // Philipp Siedler // Bjarne Stroustrup's PP // Chapter 6 Exercise 3 #include "std_lib_facilities.h" //ERROR: "#include "..;, instead #include "std_lib_facilities.h" //------------------------------------------------------------------------------ class Token { //ERROR 1/5:…

## calculator 1.3 [adding curly brakets]

Bjarne Stroustrup “Programming Principles and Practice Using C++” Chapter 6 Exercise 2 Using std_lib_facilities.h by Bjarne Stroustrup. [code language=”cpp”] // Philipp Siedler // Bjarne Stroustrup’s PP // Chapter 6 Exercise 2 //input: {4 + 3} / 3; #include "std_lib_facilities.h" //ERROR: "#include "..;,…

## calculator 1.2 [bug fixes]

Bjarne Stroustrup “Programming Principles and Practice Using C++” Chapter 6 Drill Using std_lib_facilities.h by Bjarne Stroustrup. [code language=”cpp”] // Philipp Siedler // Bjarne Stroustrup’s PP // Chapter 6 Drill // // This is example code from Chapter 6.7 "Trying the second version"…

## calculator 1.2

Bjarne Stroustrup “Programming Principles and Practice Using C++” Chapter 6 Try This Page 216 Using std_lib_facilities.h by Bjarne Stroustrup. Code: // Philipp Siedler // Bjarne Stroustrup's PP // Chapter 6 Try This Page 216 #include "std_lib_facilities.h" class Token { public: char kind;…