Currently, there are a plethora of solutions developed to help students learn the basics of programming. However, there is a relative paucity of solutions that cater to problems students face when learning programming that is mainly caused by the abstract nature of programming, misconceptions of programming concepts, and lack of motivation. Hence, in this study, a framework to address the abstract nature of programming and common programming misconceptions is developed. The framework consists of three modules that correspond to each issue, powered by a simulation engine. The first module is developed to address the abstract nature of programming by representing programming concepts with concrete objects in the virtual environment. The second module employs simulation techniques such as interactions and player perspectives to address common programming misconceptions. Lastly, the third module employs elements in the virtual environment to engage students when learning through the system. To evaluate the system, 60 participants were randomly divided into the control group (N=30) and the experimental group (N=30). Participants in the control group were taught using a video lecture while participants in the experimental group were taught using the developed intervention. Evaluation results gathered quantitatively indicated that the VR intervention was able to significantly increase programming concepts comprehension and address common programming misconceptions. Participants also rated the developed VR intervention to be significantly more engaging than the video lecture.