Computer codes

Most of you already have an idea what computer programming is about. It is the process of writing source codes for computer applications using a programming language. Basically you give the computer a set of instructions to carry out using the programming language. We have many programming languages, many of which include python (which I’m currently working with at university), java, c++, c, processing, BASIC (Beginners All Purpose Symbolic Instruction Code). No matter what programming language you use, in order for the computer to understand and execute the instructions given, it converts it into the machine code. This process of converting the instruction to machine code is called compilation.

On this page below, you can see different codes written by me using a programming language and what the code does. You can try and edit any of the codes out yourself if you are interested. The codes on this page were saved and uploaded here in form of a word document by me, copy and paste them into the required IDE for the language it was written in to be able to run it.

The code below (code1) was written in python, if you want to try it out, download the python IDE and the corresponding pygame version that goes with it. What the code does is enable you to draw bars of lengths of your choice in the form of a bar chart.When you run the code, it gives you the option to enter the length of the different bars you would like to draw in a bar chart and then you enter “0” when you are done and then it automatically draws it for you. To also be able to run this code, you will need to download the library(named Py110 in the link),created by my Lecturer, James Shuttleworth. This library is available for download for the following link http://creative.coventry.ac.uk/~james/Py110.py. Don’t download it using Internet Explorer and save the two files in the same folder and then you can successfully run it.

code1

“code2” is a very simple code also written in python. To run this code you also need to download the python IDE and the version of pygame to go with it, you also need to get the library from http://creative.coventry.ac.uk/~james/Py110.py ,created by my Lecturer, James Shuttleworth and have it saved in the same folder as the code. Use chrome or mozilla to download the library not Internet Explorer. What this code does is just ask you what the opposite of the logic “a and b” is and then displays four different options for you to choose from with the correct answer also included in it. If you get the answer right, it tells you that you are right by writing “correct” and also displays the sign for marking an answer as right. If you get it wrong, it let’s you know, you’re wrong by writing “wrong” and also  displays the sign for marking an answer as wrong.

code2