# CategoryChapter 05 – Principles and Practice Using C++

## week day values

Bjarne Stroustrup “Programming Principles and Practice Using C++” Chapter 5 Exercise 14 Using std_lib_facilities.h by Bjarne Stroustrup. [code language=”cpp”] // Philipp Siedler // Bjarne Stroustrup’s PP // Chapter 5 Exercise 14 #include "std_lib_facilities.h" int main() try { vector<string> dayVec = { "Monday",…

## bulls and cows number guessing game [random seed]

Bjarne Stroustrup “Programming Principles and Practice Using C++” Chapter 5 Exercise 13 Using std_lib_facilities.h by Bjarne Stroustrup. [code language=”cpp”] // Philipp Siedler // Bjarne Stroustrup’s PP // Chapter 5 Exercise 13 /* input: 3 4630 y 2 4567 4567 6275 n */…

## bulls and cows number guessing game

Bjarne Stroustrup “Programming Principles and Practice Using C++” Chapter 5 Exercise 12 Using std_lib_facilities.h by Bjarne Stroustrup. Code: // Philipp Siedler // Bjarne Stroustrup's PP // Chapter 5 Exercise 12 //input: 4621 //input: 4567 //input: 1234 #include "std_lib_facilities.h" int main() try {…

## largest number in fibonacci series

Bjarne Stroustrup “Programming Principles and Practice Using C++” Chapter 5 Exercise 11 Using std_lib_facilities.h by Bjarne Stroustrup. [code language=”cpp”] // Philipp Siedler // Bjarne Stroustrup’s PP // Chapter 5 Exercise 11 #include "std_lib_facilities.h" int main() try { vector<int> fibonacciNum{ 0,1 }; bool…

## sum of integer range [differences]

Bjarne Stroustrup “Programming Principles and Practice Using C++” Chapter 5 Exercise 10 Using std_lib_facilities.h by Bjarne Stroustrup. [code language=”cpp”] // Philipp Siedler // Bjarne Stroustrup’s PP // Chapter 5 Exercise 10 //input: 3 //input: 1 2 3 #include "std_lib_facilities.h" int main() try…

## sum of integer range [no doubles]

Bjarne Stroustrup “Programming Principles and Practice Using C++” Chapter 5 Exercise 9 Using std_lib_facilities.h by Bjarne Stroustrup. [code language=”cpp”] // Philipp Siedler // Bjarne Stroustrup’s PP // Chapter 5 Exercise 9 //input: 3 //input: 1.2 4 3.2 5x #include "std_lib_facilities.h" int main()…

## sum of integer range

Bjarne Stroustrup “Programming Principles and Practice Using C++” Chapter 5 Exercise 8 Using std_lib_facilities.h by Bjarne Stroustrup. [code language=”cpp”] // Philipp Siedler // Bjarne Stroustrup’s PP // Chapter 5 Exercise 8 //input: 5 //input: 3 5 6 3 34 54x #include "std_lib_facilities.h"…

Bjarne Stroustrup “Programming Principles and Practice Using C++” Chapter 5 Exercise 7 Using std_lib_facilities.h by Bjarne Stroustrup. [code language=”cpp”] // Philipp Siedler // Bjarne Stroustrup’s PP // Chapter 5 Exercise 7 //input: 1 2 3 #include "std_lib_facilities.h" int main() try { float…

## celsius to kelvin and fahrenheit

Bjarne Stroustrup “Programming Principles and Practice Using C++” Chapter 5 Exercise 6 Using std_lib_facilities.h by Bjarne Stroustrup. [code language=”cpp”] // Philipp Siedler // Bjarne Stroustrup’s PP // Chapter 5 Exercise 6 //input: 24 #include "std_lib_facilities.h" double ctoftok(double c) { //celsius to fahrenheit…

## celsius to kelvin and vice versa

Bjarne Stroustrup “Programming Principles and Practice Using C++” Chapter 5 Exercise 5 Using std_lib_facilities.h by Bjarne Stroustrup. [code language=”cpp”] // Philipp Siedler // Bjarne Stroustrup’s PP // Chapter 5 Exercise 5 //input: 24c //input: 24k #include "std_lib_facilities.h" double ctok(double c) { double…