PROGRAMMING
Saturday 22 November 2014
Key Features of Procedural Programs
Pre-defined functions
Local variables
Global variables
Parameter passing
Modularity
Procedures
Programming libraries
Friday 21 November 2014
Suitability of Procedural Languages for Graphical Applications (D1)
Procedural languages are good for graphical applications as they allow the user to input the information without having to look at the code, this is good as it keeps it graphical and doesn't get the code involved for the user and in turn makes it a lot easier for the user to input the data themselves. They just put whatever information into the allocated box and the information will get added to the code. It also allows the program to run smoothly.
package GraphicalExample;
import javax.swing.JOptionPane;
public class GraphicalExample {
public static void main(String[] args) {
String yourName;
yourName = JOptionPane.showInputDialog("What is your name?");
System.out.println(yourName);
JOptionPane.showMessageDialog(null, "Your name is " + yourName);
Above is an example of me creating a simple graphical program using a procedural language (Java). As you can see all the program does is let you input you're name and then shows you what your name is in another window.
In my opinion I think that Event Driven Languages such as Visual Basic is better for graphical applications as it has a lot more functionality options, There is a graphical way of coding (Drag and dropping buttons and other tools etc.) It is also more intuitive.
package GraphicalExample;
import javax.swing.JOptionPane;
public class GraphicalExample {
public static void main(String[] args) {
String yourName;
yourName = JOptionPane.showInputDialog("What is your name?");
System.out.println(yourName);
JOptionPane.showMessageDialog(null, "Your name is " + yourName);
Above is an example of me creating a simple graphical program using a procedural language (Java). As you can see all the program does is let you input you're name and then shows you what your name is in another window.
In my opinion I think that Event Driven Languages such as Visual Basic is better for graphical applications as it has a lot more functionality options, There is a graphical way of coding (Drag and dropping buttons and other tools etc.) It is also more intuitive.
Modular Elements are Important (M1)
Modularity is when you split your code up into separate manageable pieces. Making it easier to read, follow and understand. Doing this is important if you aren't the only person working on the program as anyone else will be able to see what does what, when it does it and where. More specifically Modularity separates code into functions and procedures. each module that it makes performs one function and contains all the source code to perform that function.
Modularity is a solution for the problem with large programs as it allows you to debug a lot easier as you can find the issue quickly. By breaking the program into modules that perform clearly defined functions you can find the source of the problem quickly and easily.
Here is an image example of modularity taken from a program that creates attributes of a human being. As you can see the methods which makes the attributes are split (Making each attribute in it's own method instead of all in one) This makes the code easier to read and it will be easy to find any problems it may have.
Modularity is a solution for the problem with large programs as it allows you to debug a lot easier as you can find the issue quickly. By breaking the program into modules that perform clearly defined functions you can find the source of the problem quickly and easily.
Here is an image example of modularity taken from a program that creates attributes of a human being. As you can see the methods which makes the attributes are split (Making each attribute in it's own method instead of all in one) This makes the code easier to read and it will be easy to find any problems it may have.
Subscribe to:
Posts (Atom)