#include <iostream>
using namespace std;


int main() {
	int a = 13;
	int b = 6;
	int prob = 0;
	cout << "Problem #" << ++prob << endl; //problem 1 is below
	//first
	cout << "---" << endl;
	cout << a / b + 1 << endl;
	//second
	cout << "---" << endl;
	if (true || false) {
		cout << 5 << endl;
	}
	else if (true || true) {
		cout << -3 << endl;
	}
	//third
	cout << "---" << endl;

	int i = 0;
	while (i < 6) {
		cout << i * 2 << endl;
		++i;
	}
	//fourth
	cout << "---" << endl;
	{
		int j = 17;
		int n = 5;
		while (j > 0) {
			j = j / 2;
			cout << "j=" << j << endl;
			j = j - 1;
		}
	}
	//fifth
	cout << "---" << endl;

	{
		int b = 4;
		if (b % 2 == 0 && b > 4) {
			cout << b / 2 << endl;
		}
		if (b % 2 == 1) {
			cout << b + 1 << endl;
		}
		else {
			cout << b + 4 << endl;
		}
	}
	cout << "Problem #" << ++prob << endl; //problem 2 is below
	char next = 'a' - 1;
	cout << " - " << static_cast<char>(++next) << " - " << endl;
	cout << "#include<ctime>" << endl;
	cout << " - " << static_cast<char>(++next) << " - " << endl;
	double best_40m_freestyle_time; //requires deduction
	cout << " - " << static_cast<char>(++next) << " - " << endl;
	cout << "seeds the random number generator" << endl;
	cout << " - " << static_cast<char>(++next) << " - " << endl;
	cout << "+/*-%" << endl;
	cout << " - " << static_cast<char>(++next) << " - " << endl;
	cout << !((true && false) && (true || false)) << endl;
	cout << " 0 above is false, anything else is true " << endl;
	cout << " - " << static_cast<char>(++next) << " - " << endl;
	int x = 5;
	//	cin >> x;
	//answer to problem begins here:
	//problem was meant to include all odd numbers too
	if (x % 2 == 1)
		x = x + 2;
	//end answer
	cout << "Problem #" << ++prob << endl; //problem 3 - debugging problem
	//correct code is below, you will be expect to describe the error
	//do not simply list the line # or restate the code
	//describe what is wrong:

	// Prompt the user for a number
	int n;
	cout << "Enter your number: "; // 2 errors: >> were wrong way, no semi-colon
	cin >> n;// removed >> endl; //no endl is allowed with cin

	//Say if number is even or odd
	if (n % 2 == 0) {
		cout << n << " is even" << endl; //missing << after n and n is even in this case
	}
	else {
		cout << n << " is odd" << endl; //same error as above, but this one is odd so okay
	}

	//4 compilation errors and 1 logical error

	cout << "Problem #" << ++prob << endl; //problem 4 - writing code
	//ask the user for a decimal number between 1 and 10 and keep asking until they give it

	double userInput;
	cout << "Enter a decimal between 1 and 10: ";
	cin >> userInput;
	while (userInput < 1 || userInput > 10) {
		cout << "Improper Input. Please, enter a decimal between 1 and 10: ";
		cin >> userInput;
	}
}