# **Guide for Installing Dev C++ and Python on Windows - HIMTI PBP TECHNO**
## Dev C/C++ Installation
Dev C++ is an IDE used by BINUS University for learning C/C++ programming language.
The minimum requirements to be able to run Dev C++ 5.11 are:
* Operating System: Windows XP/Vista/7/8/8.1/10/11
* RAM: 2 GB or more.
* Storage: 500 MB or more.
* Processor: 1.0 GHz Intel Pentium or higher.
Here are the installation steps of Dev C++:
### 1. Download Installer
The installer for Dev C++ can be downloaded [here](https://sourceforge.net/projects/orwelldevcpp/)
### 2. Setup Installer
After the download process is complete, open the downloaded installation file(.exe).
* Click **I Agree**

* Make sure the installation type selected is full by checking the appropriate checkbox as shown below then click **Next**

* Adjust the installation location to your liking. then click **Install**

<br>
### 3. Installation Process

<div style="text-align:center;">
Installation process
</div>
<br>

* Then check the **Run Dev-C++ 5.11** option then click the **Finish** button
<br>
### 4. Setup Debugger and how to use (Optional)
#### Why debugger?
Debuggers or debuggers are very helpful for testing the process of a program. The debugger displays the variables of a process when it encounters a breakpoint, so the debugger is very useful for analyzing and fixing problems or bugs in programs (Debugging). In C/C++, one of the debuggers that can be used and implemented in Dev C++ is GDB.
#### Setup GDB(Debugger) on Dev C++
To be able to use GDB on Dev C++, following steps are required:
* Open Dev C++ and on the **Tools** topbar select **Compiler Options**

* Then in the compiler options window select **Settings** then select **Linker** in it, after that in the **Generate debugging information** option select **Yes** and save changes.

#### How to use GBD(Debugger) in Dev C++
* First create a project on Dev C++, here I will choose **Empty Project**

* On the topbar go to **view** make sure **Project/Class Browser** is checked

* To add breakpoints and remove breakpoints click the line number in the code editor. This stage can be done before or after compiling.

* In the bottom window select the debug tab, to add the variable you want to watch select **Add watch**. to start debug click Debug or <kbd>F5</kbd>.

* after entering the number in the console the program will process the number in the loop and hit the breakpoint so that the execution is paused and show values of the variables in the watchlist.

* to continue execution, on the bottom tab click **continue**

after 1 time continue
* to forcefully stop program execution click **Stop Execution**
* besides that the debugger can also display machine code that is executed using **View CPU window** option
## Installation of Python and Visual Studio Code
### About Python
Python programming language is one of the easiest programming languages to learn. Besides its convenience, Python also plays an important role in data analysis, machine learning, deep learning and so on. In addition, this language is also used by students from BINUS Senayan as the main programming language. Python on windows can be installed in various ways. In this guide the installation method used is via chocolatey.
### About chocolatey
Chocolatey is a package manager (using C#) that can be run via the Windows command shell. these packages include applications, libraries, dependencies and so on. Chocolatey can simplify the download and installation stage of a program with just a single line of command like apt on Linux.
### About Visual Studio Code
Visual Studio Code is an IDE (Integrated Developer Environment) developed by Microsoft. Visual Studio Code has compatibility as a code editor which suitable for various programming languages such as Python, Javascript, C/C++, C# and many more. With extensions, VS Code can be modified to provide more features for programmers. The IDE used by BINUS University for the Python programming language itself is Visual Studio Code so this guide is intended for installing Visual Studio Code as a Python IDE.
### Installing Python and Chocolatey
#### 1. Install Chocolatey
* Press the windows key or search then search for powershell
* Then in Windows Powershell select the **Run As Administrator** option

* copy the code below then paste it into the powershell that was opened and press enter
```
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
```
#### 2. Install Python via Chocolatey
* To install python via chocolatey, you can use the command
```
choco install python
```
* Then if there is a request to install another package enter character **A** to allow everything.
* If the installation process is complete then reboot / restart your PC.
#### 3. Post Python Installation
* To check that python is installed, open powershell like before then use the command
```
python3
```
* If the command directs to the microsoft store or not like the image below

* then try running this command
```
python
```
* If it matches the image above, run the command below (Only applies to python 3.11)
```
Copy-Item -Path "C:\Python311\python.exe" -Destination "C:\Python311\python3.exe"
```
### Installing Visual Studio Code
#### 1. Download Visual Studio Code
Visual Studio Code can be downloaded via [official site](https://code.visualstudio.com/download). After visiting the site select the Windows option to download the Windows-specific installer.
#### 2. Setup Installer
* After the download process is complete, open the downloaded executable file (.exe).
* Then select **I accept the agreement** if you agree with the terms and conditions shown then select **Next**.
* Select all Tick and **Next** again.
* Then click the **Install** option.
* After the installation process is complete, please reboot or restart your PC.
#### 3. Extension installation
* Open Visual studio code that is already installed
* Then click the extension option on the left of the screen or use the shortcut <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>X</kbd>

* click the search field and search for **python**
* Then select the first option then click **install**

* In the search field again look for **code runner**
* Then select the first option then click **install**

#### 4. Setup Debugger and How to use (Optional)
The python debugger in visual studio code is automatically setup when installing the python extension. Here's how to use the python debugger in visual studio code:
* Create a python file using <kbd>F1</kbd> then type **create file** and select **Python File**
* Enter the code you want to debug
* Then add a breakpoint to later pause the execution when it reaches that line. To add a breakpoint, click the left of the code line number until it becomes a red circle and click again if you want to erase the breakpoint. This process can be done either before or after the compile process.

* To debug, on the left side of the screen select the option **Run And Debug** or with the shortcut <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>D</kbd>

* Then click **Run and Debug** or <kbd>F5</kbd>. If the file has not been saved, a window will appear to save the file.
* After entering the input number into the terminal, the execution will stop at the breakpoint and display the values of the variables.

* To continue execution press <kbd>F5</kbd>

<div style="text-align:center;">After Continue</div>
<br>
* To forcibly stop execution use the stop button or <kbd>Shift</kbd> + <kbd>F5</kbd>