Tuesday, 13 December 2016

U22 - A2

A Parent’s Guide to the World of Computer Games

Within the world of computer games there are many different genres of computer games and I will try my best to explain them:
Action Games: This type of game genre is one that focuses on physical challenges such as hand-eye coordination and reaction-time. This genre is more of a blanket statement that covers a lot of other game genres. In these types of games, the player will control a set character like Batman and they must move the character through a level while doing different things like picking up special items and beating enemies. When the level ends the player is usually challenged with a really hard enemy to defeat or a big puzzle that they need to work out.
Role-Playing Games (RPG): This is a game genre where you, the player, create their own character to play as. This kind of game usually has a really good story that you can follow and will change slightly every time you play it. As you play the game your character gets better through items and skills. As your character gets stronger so do the enemies that you fight so the player doesn’t get too powerful and the game becomes easy.
Adventure Games: An adventure game is a game genre where the player takes the role of the main character in an interactive story based on exploration and puzzle-solving. Like Tomb Raider, because of the games focus on story. The story will often take place in lots of different places and because of this the player will move from one area to another and then the player will need to move around the new environment finding new things and moving through the story.
Real Time Strategy Games (RTS): This is a type of game where you have to constantly make decisions so you can win the game. One of the best examples I can give for this type of game is the Sid Meier’s Civilization series, in this game it is up to the play how they improve their civilization and in what way the people evolve. As you play the game you are at constant risk of being attacked by other civilizations, this is why it is up to you how you plan your moves so you don’t lose the game.
Strategy Games: This is very similar to Real Time strategy except it doesn’t have the real time element to it (obvious I know). The difference with this is that you need to plan a few steps ahead like in Chess. Some people prefer this to Real Time strategy because it removes the reactive element which some people can’t handle very well.
Puzzle: This type of game is easily the most straightforward genre of game. This is a type of game were you are presented with different scenarios where you need to perform specific steps in order to move onto the next part of the game.
Platform: Platforming games are the original gaming concept that took the world by storm. The two most popular platforming games of all time are Mario and Sonic. These games are where you have a character that the player must guide and they need to jump between suspended platforms to get to the end of the level.
Simulations: To put this type of game as simply as possible, these games let you do real things but in a game. For example, there is a game called Euro Truck Simulator; in this game you are employed as a truck driver and you are tasked with driving all over Europe to make deliveries. Alongside this, the journey are in real time, if a trip will take you 6 hours then you will be sat at your computer for 6 hours making the delivery.
Sports Games: This is similar to simulations but, it’s for different sports such as football and rugby, when you play this game you choose a team; you choose your opponent and then you play a match where you control the individual players to win.
Stealth Games: These games are based on your character not being caught. So, don’t get caught and you will win the game. There are many different game scenarios where stealth is the primary focus, these are found in games like; Thief, Skyrim and Metal Gear Solid to name a few.
Combat Games: This is basically a fighting game like Street Fighter, Tekken and Mortal Kombat. These games are where you control a fighter and through different button combinations attack your opponent until you win.
First Person Shooter Games (FPS): This is your Call of Duty and Battlefield games. This is because you play the game as though you are the character looking through their eyes. Hence the First Person part; the shooter part is the fact that you use a gun 99% of the time and that’s why it’s called a shooter.
Educational Games: These are the games that you want your kids to play but, your kids really don’t. This is because these games essentially extend the amount of time children spend in education rather than playing and experiencing the world. There are some educational games that are blatantly obvious. Anyone would be able to see that the game they are playing is educational however, there are some that don’t feel like they are teaching you things and those are the best kinds of educational games. There are even some games that have been adapted such as Minecraft to have educational benefits.
Massively Multiplayer Online (MMO): Games like World of Warcraft and Guild Wars are examples off MMOs. These games have hundreds of players all online at the same time and they can freely communicate with one another in real time. These types of games have a strong focus on teamwork and the community found within them is usually very strong.

Gaming Platforms/Environments (Where they play the game)
Personal Computer: There are lots of games that can be played on a computer providing you have the right specification of computer to be able to play the game. Also, “Gaming Computers” can be very expensive so make sure you think about investing in one carefully before paying the premium for them.
Portable Hand Held Console: Portable gaming has improved tons in recent years. Mainly with the implementation of portable 3D gaming that was released a few years ago. Portable Hand Held gaming is mainly focused on younger children to help them during long car journey and visiting places they don’t want to go. But, all of the games can also be played by adults and there are even some games that are more tailored to a more mature audience.
Stand-Alone Platform:
Mobile Phone: If you have had a child within the past 10 years you probably realised that they constantly take your phone off you to play. Because of this there are now 100,000s of games for smartphones that are aimed at children specifically. Mobile phone games are the biggest area of the gaming industry and are why there are so many and why they are released so frequently.
Internet: Everyone in school had that one games website that wasn’t blocked by the school so they could play games during lessons (we all did it). That is what internet games are, they are simply games that are found on the internet.
Video: This one is a bit trickier. There are some content creators on websites like YouTube that utilise the annotation feature to create an interactive story or “game” by linking many different videos together to make a story.
Network: This is also called a LAN game; LAN means Local Area Network and is basically a stereotypical picture of a group of gamers all in their mum’s basement. This is because they all use their own computer or console but, play together on the same network. It’s basically split screen but with your own screen, console/computer and controller.

Technology
Graphics: Graphics within games have improved at a monumental rate, if you think back to the days of Pong and Pacman the graphics were appalling by today’s standard. This is because the games that are being released today have to look as realistic as possible or people won’t play the game (there are exceptions to this rule). This is because computers and gaming consoles have gotten more and more powerful so they are able to handle more things at once. To simplify it as much as possible, games are made up of lots of little shapes called polygons. To make a game look better you need to use more polygons, as technology has improved computers and game consoles have been able to handle more polygons hence why games look better.
Artificial Intelligence: When you walk past certain characters in games like Skyrim you may have noticed that they sometimes talk to you. This is because they have been given the computer equivalent to a brain and when they see you walk past them they decide to talk to you or they wait for you to start the conversation.
Audio: Audio quality within games has improved as well (in case you can’t tell everything in games is getting better). With microphones that are able to record sound much more clearly and with audio editing software that is really good (and very expensive) game audio designers are able to make sounds as realistic as possible. The best way to hear this is in racing games, the way the different cars and engines sound is incredibly life like and this is due to the improved quality.
Gameplay (what the player does): Game Companies need to make gameplay as intuitive as possible to make sure that you enjoy playing their game and find it easy to do so. In all the different games that are out nowadays they all have their own way of being played.

Scripting: The scripting is used to make the different NPCs within a game act in specific ways and it also causes different items to act in different ways. So, there are some games that talk to the player when they walk past. This is an example of scripting.

Sunday, 13 November 2016

Unit 22 - A1

When looking at Computer Games it is known that they are both positively and negatively (depending on whom you ask) affecting society and individuals; we can break down each of sectors to the “Societal Impacts” and the “Individual Impact”.


Societal Impacts
·     Social Isolation – There are some people that play computer games way, way too much; they end up secluding themselves from the rest of society in order to play those games. This affects the person by preventing them from interacting with the rest of society and in turn can prevent the person from developing adequate social skills. This is becoming an epidemic which is causing there to be an issue with the future generations because; more and more people are growing up playing games which is causing more people to suffer from this.
·     Time Spent Playing Games – There is a frightening increase to the amount of time people spend playing computer games per day. This is because people used to simply go and play computer games for approximately an hour a day or even every other day. The difference though that comes with modern day gaming is that the games are longer and they have much more replay ability. This is why there has been an increase to the amount of time that people spend playing computer games. 
·     Expense – The cost of gaming systems and games themselves have been skyrocketing in recent years. For PC gaming, graphics card (the component needed to play games) can cost up to £1000.  That is for a single component, games consoles can cost around £250. Alongside the initial cost for the game playing facilities, you need the games themselves to play. Games have gone up in price as well and can cost £40-50 and that’s just for the standard edition for a game. So, gaming is very expensive.
·     Separating Reality and the World of Gameplay – There are some people that are somehow unable to distinguish the difference between the two. This is because they spend that much time playing their games that it can cause the player to have hallucinations while out in the real world. This is because their brain becomes too use to seeing the different images that are created by the games that are played and then it means that the brain will subconsciously expect to see certain events occur and that can cause hallucinations to occur.
·     Educational benefits/drawbacks – There are some games that help to promote the learning that some children and even adults undertake. But, gaming is also notorious for reducing the amount of time people spend bettering themselves through education. When most people are faced with the option of playing a computer game or doing homework 99.99999% of people would rather play a computer game of their choice. 
·     The Future – As gaming has been evolving at such an exponential rate there is a massive societal impact that comes with this evolution. As new gaming technology takes the world by storm, these causes there to be new approaches in different types of technology to accommodate the gaming market. For example, now that there is more support for 4K gaming with the release for the Xbox One S and the PlayStation 4 Pro this means that there are going to have to be big moves in 4K TVs and how affordable they are. 

Impact on “mainstream” development

Gaming is easily the most influential industry because it is the largest industry in the world. The gaming industry has grown that much in recent years, it is bigger than the Music Industry and the Film Industry combined. This means that the gaming industry is able to control what the different technology companies release, because if it isn’t compatible with gaming consoles etc. Then most people won’t purchase the piece of technology. Also, most media that is currently being consumed is based around gaming. For example, the number one category on YouTube us Gaming, a majority the most popular YouTubers are gamers. This goes to show how influential gaming is.

Individual Impacts
·     Use of Sound – Sadly, most people only focus on the gameplay mechanics, graphic quality, user interface etc. When they play a computer game; one of the biggest factors within a game must be the soundtrack; just like in movies, the soundtrack of a game is what gives the game life. This is because the music within a game gives ambience to all the environments within the game. There are naturally, some games where this doesn’t apply as much but, there are plenty of games where the music is what makes the game so amazing. One of my person favourite game soundtracks is from a game called Darksiders 2. This is because the soundtrack suits all of the different environments within the game, when you are traveling through heaven you get very soft music that gives a sense of tranquillity, when moving through hell the music is eerie and demonic. Even the baron wasteland of the earth, the music is nearly non-existent to give the feeling of emptiness within the environment. The other major area where sound is crucial is during important plot points, there is a scene within the game where you must fight a giant being which is basically the main NPCs child and savour, you must kill this giant being and then the main NPC revives him and sacrifices himself. The music during this scene is very emotional and helps the player to understand the magnitude of the situation.

·     High Score League Tables – When a game has some form of leader board this can have both good and bad repercussions. In terms of the good individual impacts; when someone first plays a game and they perform a task such as a race in a racing game, they may see that in the world their time was the 10th best. This will give the player a sense of accomplishment because they know that they are in the top 10 best players for that race. This however, can become a negative because the player may be angry that they are only the 10th best player. This means that player may then constantly replay the same race to climb the leader board and try and get to first. Then they may be content with their performance and ranking. The other issue then arises if the player has been knocked off their perch as number 1. This may anger the player. When players know that they can do something a millisecond faster, or get a meter further, or get another 100 points; that causes a sense of addiction to the game because the player will truly believe that they can do better and that means that they will keep doing the minigame/task over and over and over again to get that bonus score.

Competitiveness – There is always such thing as healthy competition but, in the gaming community it
doesn’t exist. This is because there are some times where people play games and it angers them that it doesn’t go the way they want it to. The allure that comes with games is that you control the outcome, so when you do everything that you can and you still lose it gets frustrating. When you are playing against other players that level on control is taken away from the player and they either need to be really good at the game they are playing or they need to be really lucky. Because of this factor that can cause a lot of players to get incredibly frustrated and believe that the game is not competitive and is entirely based on luck.
Peer Pressure – I have experienced this and even caused it in the sense of gaming. When your friends all play a game and you want to play it with them they tell you to go out and buy it, you may then have some form of objection to this suggestion such as; you can’t afford it, you don’t have time to play it etc. and then your friends will say “borrow money off your mum”, “buy it on payday” and other suggestions to that effect. They will then continue to push the game and tell you to buy it.
Fun – Games are easily the most entertaining thing that we can do. They are interactive films (depending on the game) and they allow you to do things that you can’t do in real life. As much as I would love to be Batman I’m not a multi-billionaire so I can’t do it but, I can afford £30-40 to play a game where I can be Batman and that is enough for me. I also can’t afford to drive around in a Lamborghini and do over 200mph down the motorway. In Forza Horizon 3 I can do that and I do, regularly.  
Educational Value – Games are much better at being educational when compared to music, text and video. One of the up and coming educational tools is a small game called Minecraft. This is because you can build interactive quizzes that are great for teaching. For example, you could make a maths quiz where the children are given two options, if they get it right they fall in water and if they get it wrong they fall in lava and has to respawn at the beginning of the quiz again. That is a simple example of how a game can be used for educational situations.

Expectations – When I buy a game I have a lot of expectations because I want to be getting my money’s worth. If the game doesn’t meet my expectations then I am unhappy with my purchase and most likely not make a repeat purchase for games made by the same company. For example, when the newest version of FIFA comes out, I expect the players to perform as well as they do in reality (or at least their average performance). This means that when I use Cristiano Ronaldo or Lionel Messi, I expect them to be the best players in the game because they are the best players in the world. 

Wednesday, 26 October 2016

Unit 14 - A1

Task 1
What is an Event Driven Language?
An even driven language is very self-explanatory. This is because as certain events occur within the language which causes different events to occur for example, when you click on different icons within the operating system that event causes the program to load within the operating system. The same can happen within different apps or games, as the user performs different inputs, those events cause responses from the game.
Typical events in your chosen language – Python
The language that I have chosen is Python, this is an Event Driven programming language because you are able to code into the program and then that allows a user to provide their own input into the system and then the appropriate output occurs (hence why it is an event driven language).


Key Features:
Service Oriented – This is something in event driven programming and it means that it takes very little of a computers processing power meaning is does not slow down the computer. “Services” themselves are programs that run in the background of an OS (Windows, Mac, Linux), these have services so your computer system is much more user friendly. An example of this could be, when you first plug a USB memory stick or input device (keyboard) the operating system begins to install the necessary drivers in the background.

Time Driven – A time driven feature in event driven programming runs a specific code based on a timely basis every hour, on a specific day, once a week etc. An example of this could be scheduled Virus Scans, this is where you go into your respective Anti-Virus software and you choose the days that a scan is run and what time the scans are to run.

Event Handlers – These are in event driven programming and are designed to run a specific action when a specific event is triggered. The best example that can be used to help understand this is the key combination of “Ctrl + Shift + Esc”, when these buttons are pressed together they trigger the event to bring up the Task Manager application.

Trigger Functions – They are mechanisms that decide what code to run when a specific event occurs, trigger functions are used to select which event handler to use for the specific event that has occurred. Many devices have trigger functions with a specific event that runs for it. For example, automated doors have a sensor that when someone is in proximity of the sensor, it sends a signal to open the door.

Now I am going to describe some of the benefits of Python:
·         Simple – Python is a simple and minimalistic language. Reading a program that is well written in Python, can be compared to standard English. This is because coding in Python follows a relatively logical process and doesn’t really require strange coding words or number-word combinations. If you want to change something just think about what it’s called and you can change it! Also; with Python having this element of pseudo-code integration, it can be one of its greatest assets. It helps because you can simply figure out a solution to any programming issues that may arise rather than work out a very convoluted solution, because the language is so intuitive.
·
  
Easy to Learn – This feature co-insides with the previous point, because Python has such a simple syntax that the language has.
·
  
Free and Open Source – Python is an example of Open Source software. This is basically where you can freely distribute copies of the software, you can read its source, you can even make changes to it! This is another reason why Python is good, because it is open source it means that it is constantly being improved because of the Python community.
·
  
High-Level Language – This is something that is quite counter-intuitive about Python. When something is a “High-Level” language it doesn’t mean that it is difficult, it just means that the programmer doesn’t have to concern themselves with “Low-Level” details such as managing memory usage used by the program.
·
  
Portable – Thanks to Python’s open-source nature, Python has been ported to many different platforms (this means that is has been changed in order to make it work on other systems). All Python programs can work on any of these platforms (and there are a lot); Linux, Windows, FreeBSD, Macintosh, Solaris, OS/2, Amiga, AROS, AS/400, BeOS, OS/390, z/OS, Palm OS, QNX, VMS, Psion, Acorn RISC OS, VxWorks, PlayStation, Sharp Zaurus, Windows CE and even PocketPC.
·
  
Interpreted – A program that is written in a “Compiled Language” such as C or C++, it is converted from the source language e.g. C or C++, into a language that is spoken by your computer (binary code is the most common, it is 0s and 1s). This is done through the use of flags and options. When you run the program written in those languages, the linker/loader software copies the program from hard disk to memory and starts running it.
Python on the other hand, doesn’t need to be compiled into binary. You can just run the program directly from the source code. Internally, Python converts the source code into an intermediate form called bytecodes and then translates this into the native language of your computer and then runs it. When all of this is considered, it actually means that Python is easier to use simply because you don’t have to worry about compiling the program, making sure that the proper libraries are linked and loaded. This also makes your Python programs more portable, since you can just load the program onto another computer and 99% of the time it will just work.
·
  
Object Oriented – Python supports procedure-oriented programming as well as object-oriented programming. In procedure-oriented languages, the program is built around procedures or functions that are nothing but reusable pieces of the program. In object-oriented languages, the program is built around objects which combine data and functionality. Python has an incredibly powerful yet comically simple way of performing OOP, especially when compared to “big languages” such as C++ and Java.
·
  
Extensible – If you were to need a critical piece of code to run very fast or if you were to want to have some piece of algorithm not to be open, you can code that part of your program in C or C++ and then use them from your Python program.
·
  
Embeddable – You can embed Python within your C/C++ programs to give “scripting” capabilities for your program’s users.
·
  
Extensive Libraries – The Python Standard Library (PSL) is massive. It can help you perform various things involving regular expressions, documentation generation, unit testing, threading, databases… The list goes on and on, what’s more is that this is available wherever Python is installed. This is called the “Batteries Included” philosophy of Python. Even though Python already has this mind blowing library built in, there are other quality libraries such as wxPython, Twisted and the Python Imaging Library to name a few!


Now then, even though all of this is fantastic. As with anything there has to be some disadvantages that comes with Python. These are some of the disadvantages that I have found from my research:
·
  
Python isn’t the best for memory intensive tasks – This is because it is a High-Level language as mentioned before. Because you can’t specify the memory allocation within Python you can’t optimise Python for memory intensive tasks.
·
  
Python is an interpreted language and is slow when compared to C, C++ or Java – Even though you can use C and C++ within Python, the language itself is still very slow and is the reason why you shouldn’t use Python for something that needs to perform at high speeds.
·
  
Python is not a great choice for a high-graphic 3D game that takes up a lot of CPU.
·
  
Python is evolving continuously, with constant evolution there is little substantial documentation available for the language.

Task 2

Operating Systems Are Event Driven Applications
Based on the information that I have previously stated about what an Event Driven language is, I can draw direct comparisons to Operating Systems such as Windows and Mac OS.
The first thing that helps to support that claim that operating systems are event driven is installing the Operating System itself. This is because the installation can only progress when certain events occur. For example, the installation of an Operating System cannot begin until the user has selected the language that they want the Operating System to run in. This is an example of a Click Event and only when this event has been triggered may the installation of the Operating System begin. Also, each of the stages of the installation cannot occur until the previous stage has been completed. This is also considered event driven because, only in the event of the previous stage being completed may the installation continue.
Next, once the Operating System has been installed successfully installed you are greeted with the respective GUI desktop. The desktop found within an operating system is populated by many potential event driven programs; the most obvious example would be the Start Menu. This is because you can trigger the start menu to appear by either clicking the windows icon in the bottom left corner or you can press the windows key on your keyboard. This is the event that causes the start menu to appear.


















Another way I can demonstrate that there is event driven properties within operating systems is through the drag and drop characteristics that are very commonly found within OS such as Windows. This is useful when a user wants to take their desktop and manoeuvre them to their liking.























This is an example of using the drag and drop functionality in order to move the different icons to where I want them to be. This is considered to be event driven because it is based around the click event. Because you need to use the left click and hold it, that triggers the selection within Windows and then by moving the mouse that event causes the icon to move on the screen.

The next example that I am going to discuss is when an external storage device is connected to a computer. Typically, people connect either USB sticks or SD cards to computers because they want to take the data off the storage device. This can be anything from assignments, work that they need to complete for their job or even videos and photos from their most recent holiday. Once the preferred storage device has been connected to the computer this is what causes the series of events to occur. In the case of my computer, as soon as my USB stick is placed into a USB port on my computer the USB instantly opens, this means that I am greeted with this screen:











However, if I were to use a USB stick that my computer doesn’t recognise a small window would appear towards the right of my screen saying “choose how ‘USB’ opens” and it will give you options such as; Open (this is what I usually choose because I just want to connect a USB and then use it), there is the option to have the computer automatically copy all of the files off the USB stick to your chosen hard drive and even an option that says “Do Nothing” so literally nothing happens when you connect a USB stick to your computer (not an option I would personally recommend).
There are even events within a computer that requires an input once but, then you have changed the event and it will occur on its own. An example of this would be setting your anti-virus software to run a scan every other day at 5pm. By using the traditional click event you are causing another event to occur, once the 5pm time has been set this means that the event will wait. Then when the clock on the computer says that it is 5pm, this event triggers the anti-virus software to begin scanning the computer for any potential viruses, malware and unwanted programmes. This is a different type of event but it is still an event that needs to occur before the scan can be initialised. This is simply another example of the near infinite ways event programming is present within an operating system.
Taking all the previous examples that I have already mentioned into account we can safely assume that Operating Systems are Event Driven. Everything that can potentially happen within an Operating System is event driven. Computers are meant to respond to the different inputs that can be formed by the user of the respective Operating System (Windows, Mac, Linux, Android etc.) even if we go all the way back to the beginning of using a computer, when you press the power button on a computer that is what causes the Operating System to boot. Even this blog that I am writing is entirely event driven. I needed to boot up my computer, log in to my account by using a keyboard to provide the correct input to then cause the computer to allow me to access my local user account within Windows 10. I then needed to open the Word file, this being done with the mouse and the click events. Then there is the input that is being created using my keyboards which is causing all the letters to appear within the word document, at consistent intervals throughout writing this blog I am pressing ctrl + s to trigger the save file event; and so forth and so forth. Everything that is found within an Operating System is event driven and I would hope that I have provided enough thorough evidence to prove my original statement.

Task 3

Everything is Event Driven

In this final task, I have been asked to discuss the suitability of event-driven languages for creating a non-graphical program.

To summarise everything I am about to say into a sentence; most of the things that you can think of are based on event driven programming and even some of the things you wouldn't think of are event driven.

To begin I will talk about the more obvious things that you may not have considered to be event driven within your home. 
The first thing that I will talk about is things like your kettle and your washing machine. This is because they are still event driven programs. While it doesn't seem like they are, when we think about how they work it becomes obvious as to why they are. A kettle beings to heat up the water when the button is pressed, the water is then continually heated up until the internal thermostat detects that the water has reached the proper temperature of 100 degrees Celsius. This event triggers the kettle to stop boiling and this is why kettles are event driven. Event driven programming is suitable for a kettle because it means that the water doesn't boil for too long and it means that the water won't burst out of kettle injuring the user.

Washing machines also follow a similar event driven programming. When you think about it, washing machines have all of the different settings that they can use for all of the different washing cycles and such; but then wishing each of the washing cycles there are different events that occur. For example, if you wanted to perform a simple 40 degree wash, then you would first need to set the dial for the desired wash cycle. From there, the user will need to press the begin cycle button so the washing machine initiates. From there the washing machine will have a set of events that will occur to wash the laundry, this will go from the water coming into the drum of the washing machine, to the different rotations that happen throughout the cycle. There will be different directions for the rotations and the different speeds during the cycle. Event driven programming is suitable in a washing machine because it allows the washing machine to properly clean the clothes.

Thermostats can be another thing that is event driven but this is much simpler to explain and understand, this is because as the ambient temperature around the thermostat changes so does the display as it updates to accommodate the changes in temperature. Event driven programming is suitable for a thermostat because it is connected to the central heating. In this there is a temperature target then the cannot be exceeded nor can the temperature be less than. What this means is that the room will always be a constant temperature and the user will not be too cold or too hot.

Alarm systems also work on a similar system. Very simple, but powerful. This is because when you arm the alarm you have to put in a specific code that arms the alarm. Then when the circuit is whole (as shown here)
This is the complete circuit that will be armed as the door is closed and the alarm turned on. When someone (either an intruder or the home owner) enters the house this breaks the circuit and this is what causes the alarm to trigger and begin alerting people. The alarm will only cease if the correct code is then entered again. If an incorrect code is entered multiple times or the code is not entered within a certain amount of time then the loud alarm will trigger. This is why an alarm system is event triggered. Event driven programming is suitable for an alarm, because the alarm will only trigger when the circuit is broken. This means that the alarm wont constantly go off and make a loud annoying noise.

DVD players are another example of one of the many devices that are event driven, this is because when the DVD is put into the player this event causes the player to begin reading the disk in order to produce the image onto the output device that it is connected to (screen, monitor, projector etc.) Even driven programming is suitable for a DVD player because it allows the user to change some of the settings when the DVD first starts, watch bonus content that is on the disk and even something as simple as pause the DVD and play again.

Microwaves (just like everything previously mentioned) work on the basis of event driven programming. The microwave works similarly to the washing machine, this is because when the user decides to use the microwave they can either set the microwave to a preset option or they can use a combination of power settings and timing settings to cook the food. Even driven programming is suitable for a Microwave because it means that the food/drink that has been placed into the Microwave doesn't over cook or burn and potentially damage the Microwave.

The final event driven application that I am going to discuss is a mobile phone. This can be explained quite simply as a small computer, that is basically how a mobile phone now works. Depending on the mobile phone that is being use there are different events that can be triggered. This is because there are some phones that are entirely touchscreen, touchscreen but has some buttons, and there are even some mobile phones that are entirely button based. But, they all do the same basic few things. In terms of why they are event driven, I could be here all day explaining why so, I will only comment on a few things.
First, you will need to power on the phone regardless and by pressing the power button you have triggered the phone to turn on. Once the phone has turned on, most mobile phones have a lock screen that the user is then presented with. Once presented with, the screen can then be unlocked in a variety of ways; on “old school” phones, there is typically a key on the face of the phone that corresponds with the “unlock” button. On typical touchscreen phones, when the user tries to unlock the phone they are required to either input a number code, a password or a pattern/symbol. The last example, is that there are some phones that have biometric scanners (fingerprint scanners) that a user can use to unlock their phone. These events need to be met to trigger the phone to unlock and allow the user to use it. We can even be more pedantic and say that when a person calls another person that is a series of events that trigger to allow the phone call to occur. Event driven programming is suitable for mobile phones because they are entirely interactive. They need the different events that are provided by the user in order to function. Just something like a making a phone number you need to input the phone number of the person that you want to call, therefore event driven programming is required for a mobile phone to work.


So as you can tell. Everything that in the world of technology is event driven!

Monday, 12 September 2016

Unit 6 Assignment 1

Unit 6 - Assignment 1

Task 1

The Procedural Paradigm

This is basically a set of computational steps (Procedures) in order to complete a specific task. This is a very fast process and, because of its simplistic approach, it is often the paradigm used when teaching programming to beginners due to its relative simplicity. When writing code for complex software, procedural programming would not be the preferred paradigm because the complex software would require many lines of code, making it an unwieldy and perhaps confusing way of coding.
The languages that can be included are:
C.
C++.
FORTRAN.
Pascal.
Basic.


The Event Driven Paradigm

Event driven programming is designed to react to events such as user inputs, usually mouse clicks or key presses. This allows for more intuitive and interactive programs to be created, especially when programing GUIs. EDPs also allow for easy communication between hardware and software. The event driven paradigm is generally only useful when programming for GUIs due to its interactive and reactive nature, which renders it a fairly inflexible way of programming.
The languages that can be included are:
*Any language can be used, but can be made easier by using a language that provides high level abstractions like FOCUS, Lisp, Perl, Python, Ruby, SAS and COBOL.
The type of programs that are made using this are things like Games. This is because they are designed to work with the input created by a user, this can also work in things such as washing machines and microwaves. A kettle is another device that also uses this type of programming. All of these work because as certain things (events) occur; washing machines reach different points in their wash cycle, microwaves work for different time periods on different settings and kettles stop heating up once a temperature target is achieved. These are actual uses of Event Driven Paradigms.

The Object Orientated Paradigm

This focuses on using Objects rather than procedures in order to accomplish a task. This can be beneficial because it is modular; this allows separate objects to respond to the same instruction differently. Also, it allows the programmer to alter specific objects without altering the whole program. OOP has a steep learning curve, requires a lot of planning and consideration of the relationships between objects can be difficult to get used to. OO programs also tend to be larger in size, which can be a problem in some circumstances.
The languages that can be included are:
C++.
Objective-C.
Smalltalk.
Java.
C#.
VB.

Task 2

Time constraints

Depending on how much time a programmer has depends on what language they will use for a particular project, this is because some languages take longer to code with than others. This is something that will have to be taken into account when deciding what coding language you want to use.

Organisational Policies

Organisations will have different policies for all the different areas/things within the company. This could be something as basic as what kind of computers & operating systems the company uses (Windows, Linux, Mac OS) and they may also have a policy on what programming languages have to be used for any systems that area created for them.
However, if the company does not have a policy on what language has to be used then the programmer can pick whatever language they believe to best suit the system that they are coding for. Through the use of the information that the programmer can collect from the company they will be able to decide what language will be best however, this will be based on the language architecture for example; Visual Basic works well on Windows but could crash when used on Linux.

Suitability

The next phase would be for the programmer to find out what the system needs to do and then what kind of program the organisation wants. The programmer will need to find out what the company uses the system for then they can help the organisation figure out what would best fit the system.

Availability of Trained Staff

It is fine making a system for an organisation however, what really needs to be taken into consideration is the other staff members within the company. The programmer needs to find out if there are IT technicians within the company and find out which programming languages they can support because it will be pointless for the system to be created in a language that the technicians don’t know.

Reliability

Everyone wants a program that does not however, that cannot always be the case. It all depends on how reliable the company wants the system to be for example; if it crashes, is it just a case of losing 10 minutes of business or will it be a full day or two?
Another factor that must be considered is that, the reliability will also depend on the time the programmer has to code which will depend on the language that the programmer uses. However, in certain cases the organisation may say that they want a program that doesn’t crash but, may only use Windows operating systems but, the problem is a lot of programs on Windows crash because the operating system was not designed very well.

Environment

A company like a supermarket may want their system to link up to other pieces of hardware such as barcode scanners, the programmer must work out whether or not the programme that is being designed is going to be compatible with the hardware or if the hardware is going to need to be updated. Once the programmer knows this he/she will be able to determine what language is needed to do the job.

Hardware

You need to make sure that the hardware that you are using is compatible with the programming language that you have chosen to use (as mentioned previously).

Development and Maintenance Costs

Although it is free to use programming languages as the software to code them on is free to download off the internet there are other costs that the company may have to pay out. The programmer will have to look at what the specs on the computers are so they can tell the company if any of their hardware needs to be upgraded; in effect it will cost them money.
There will need to be a thought on how much it will cost for maintenance on the program and again this will all depend on how in depth the programmer wants to be depending on the other factors such as time, if they just quickly throw something together then there may be a chance that it will cost the company to bring the programmer back in to make patches and fix any bugs that have come up. There will also be costs for little things like upgrades on the programme, maybe the company have bought better computers and need the programme to work smoother on the new computers so the programmer may have to put a few tweaks on the programme.

Expandability

If a company is happy with the programme that has been made for them they may want it to be expanded onto all the computers in the office, the programmer will then need to add some more coding to the programme that has been made so that it can be used across multiple devices.
If everything is running smoothly further down the line the company may call the programmer and ask them if they can expand the programme nationally or even internationally to the company’s other offices which again just means that the programmer will need a few more lines of code and it will be operational.

Task 3

Sequencing

This is the first of the three basic logic structures in computer programming; In a sequence structure an action or event, leads to the next ordered action in a predetermined order. A sequence can contain any number of actions however; no actions can be skipped in the sequence. The program (when run) has to perform each action in order with no possibility of skipping an action or branching off to another action. Basically, in a sequence everything must be done in the order that they have been set, nothing can change or it will break.

Selection

This can also be called a “decision”; this is the second of the three basic logic structures found in a computer programming. In a selection structure, a question is asked and then depending on the answer, the program takes one of two courses of action. Once that has been done the program is then able to progress onto the next event.
This structure is sometimes referred to as an “if-then-else” process, this is because it directs the program to perform in this way: If Condition A is considered True then perform Action X else perform Action Y.


Iteration (Loops)

A single pass through a group of instructions, most programs contain loops of instructions that are executed over and over again. The computer iterates through the loop, which means that it repeatedly executes the loop.
All logic problems in programming can be solved by forming algorithms using only the three logic structures, and they can be combined in an infinite number of ways. The more complex the computing needs, the more complex the combination of structures;



Task 4

This is a table that briefly explains the different Data Types that you can use within a programming language.
Data Types
Value Range
Space Occupied
Boolean
True or False
Depends on implementing platform
Byte
0 through 255 (unsigned)
1 byte
Date
0:00:00 (midnight) on January 1 0001 through 11:59:59 PM on December 31 9999
8 bytes
Decimal
0 through +/- 999,999,999,999 with no decimal
0 through +/- 999,999,999,999 with 28 places to the right of the decimal place.
16 bytes
Double
-1.79769313486231570E+308 through -4.94065645841246544E-324 † for negative values;
4.94065645841246544E-324 through 1.79769313486231570E+308 † for positive values

8 bytes
Integer
-2,147,483,648 through 2,147,483,647 (signed)
4 bytes
Long
-9,223,372,036,854,775,808 through 9,223,372,036,854,775,807 (9.2...E+18 †) (signed)
8 bytes
Short
-32,768 through 32,767 (signed)
2 bytes
String
0 to approximately 2 billion Unicode characters
Depends on implementing platform

Data Types are used for many different reasons but, they are completely situational. This is because the different types of data types are more suited to certain uses and others are more suited to other situations. This is because there are many different ways in which you can use each of the data types for example, you could use the integer data types for anything that requires a whole number; this means that it can be for values in a game or for stock numbers in a company. This means that there are certain scenarios that the different data types can be used in but, they are all related to the same thing.

Other important factors:
Logical Operators (AND/OR/NOT): Within Python there are three main Logical Operators, they are the "And", "Or" and the "Not". These work in their own individual ways:
And - This is where both the operands are true then condition becomes true. For example, (a and b is true).
Or - If any of the two operands are non-zero then condition becomes true. For example, (a or b) is true.
Not - Used to reverse the logical state of its operands. For example, Not (a and b) is false.

Selection Operators (<,>,=): There are also some Selection Operators that you can find within Python "<", ">"and "=".
< - If the value of left operand is less that the value of right operand, then condition becomes true. For example, (a < b) is true.
> - If the value of left operand is greater than the value of right operand, then condition becomes true. For example, (a > b) is not true.
= - Assigns values from right side operands to left side operand. For example, c = a + b assigns value of a + b into c.

WHILE Loops:
A WHILE Loop statement in Python programming language repeatedly executes a target statement as long as a given condition is true. The Syntax that you would use within Python to create a WHILE Loop is:
"while expression:
       statements(s)"
In this example you can see that "statement(s)" may be a single statement or a block of statements. The condition may be any expression, and true is any non-zero value. The loop iterates while the condition is true.
However, when the condition becomes false, program control passes to the line immediately following the loop.
In Python, all the statements indented by the same number of character spaces after a programming construct are considered to be part of a single block of code. Python uses indentation as its method of grouping statements.


Advantages and Disadvantages of Visual Languages/Script and Markup Language