Friday 8 January 2016

GOOD NEWS !!!!!

GOOD NEWS !!!!!
All Nd2 Computer science students,most especially the Dpt students, can now see all assignment given in class on this blog, you can also see hints and guides to solve those questions.
CONGRATULATIONS !!!!!

5 Basic Elements Of Programming


5 Basic Elements Of Programming

Instructor: Lee Webber Lee holds a master's degree in Information Systems Management. He has taught college-level computer classes.

There are five basic programming elements, or operations: input, output, arithmetic, conditional, and looping. Every program uses at least two of these. This lesson will describe each one to you and show you examples in simple code.

Five Basic Programming Elements

Programming is somewhat like working with building blocks. Given enough children's toy blocks (and enough time and ingenuity), you can build just about anything with only a few kinds of blocks. The five basic elements in programming are:
  1. input: getting data and commands into the computer
  2. output: getting your results out of the computer
  3. arithmetic: performing mathematical calculations on your data
  4. conditional: testing to see if a condition is true or false
  5. looping: cycling through a set of instructions until some condition is met
Let's look at an ATM. You walk or drive up to it, swipe your ATM card, tell it how much money you want, and, after chugging for a moment or two, it spits out cash and a receipt. In this simple example, we have input, arithmetic, and output. Here's a simple flowchart for getting $40 in 'Fast Cash' from a teller machine. We'll follow it though this lesson to show how the five operations can be mapped.

Input

Examples of input devices
Input Device Examples
Input can come from just about anywhere: a keyboard, a touchscreen, a text file, and another program are just a few examples. Input is one of the two elements that are used by every program because every program needs some data to work with. When you use an ATM, the input comes from two things: your ATM card and the information you enter on the keypad. Your ATM card has some customer identification on the magnetic strip on the back. It tells the ATM who you are so it can get your account information. But before it will do that, you have to 'authenticate' yourself. The bank wants to make sure it isn't someone who's not you trying to access your account. You authenticate yourself by entering your PIN, which is (or should be) known only to you. Once the bank is happy that it's you, it will ask you what you want to do. In this case, you just want $40, so you select 'Fast Cash,' which will take the money out of your checking. And the input part of your transaction is over. In a flowchart, input leads to the first process. In this example, it is arithmetic.

Arithmetic

Computers can perform all kinds of mathematical operations and functions, from the simple addition or subtraction needed to update your checking account balance after a withdrawal or deposit, to the complex calculus needed to put a satellite into orbit. Not every program needs to do calculations on the data that's entered, but it may still need to do some in order to control what is happening inside the program itself. We'll see that in a minute. In our example, the ATM will check your balance and, if you have enough money, subtract $40 from it. And that's the arithmetic part - the subtraction. So this part of our flowchart is a process showing subtraction.

Output

In the ATM example, a subtraction calculation is performed.
ATM Arithmetic Flow Chart
Output is the result that your program gives you. That is the whole purpose of writing a program: to ask a question and get the answer! Output can take many forms - text or graphics, either printed or on a screen, a sound - just about any form that can be interpreted and understood by a human being or another program. In the case of our teller machine, the output is one of the most widely understood things in human society: cash. Back to our example, the machine dispenses the $40 and prints a receipt. The receipt shows you how much you withdrew and what your new balance is. And that's the output. So, our flowchart goes from the subtraction to the output process, then our program ends.

Looping

Quite often, your program has to repeat an operation a number of times before the program can continue. The simplest example is adding up a column of numbers. Since a computer can only add two numbers at a time, it has to add the first two numbers, then add the next number to the total, then add the next one and the next one until there are no more numbers to be added. There are a number of different types of loops, which are used based on how the input or calculations need to be handled. All of them are either event-controlled or counter-controlled. The control part is important - if there is no control, the loop can go on forever, or until you stop the program. Event-controlled loops can be stopped by an external event. That event could be user input, perhaps in response to a prompt like 'Any More?' or by reaching the end of an input file. Counter-controlled loops are stopped when a counter in the loop reaches a predetermined value. The loop may be counting down to zero or up to a maximum value.

Stay tuned on www.olalekanakeem.blogspot.com to be continued soon. for the benefit of nd2 computer science students, Federal Polytechnic Ede Osun State Nigeria
 

What is an HTML Document? - Structure, Types & Examples

Instructor: Szymon Machajewski Szymon has taught Computer Science at a number of Higher Education institutions.

An HTML document is a file containing HyperText Markup Language, and its filename most often ends in the .html extension. An HTML document is a text document read in by a web browser and then rendered on the screen.

Definition

An HTML document is a file containing HTML code. HTML code is based on tags, which provide special meaning and instructions to text between them. A tag starts with an angle bracket, the 'less than' sign: '<'. The tag ends with an angle bracket, the 'greater than' sign '>'. Tags tell the processing program, often the web browser, what to do with the text. For example, to make the word 'Hello' bold, you would use the opening bold tag <b> and then the closing bold tag </b>, like this:
<b>Hello</b>
HTML is defined by the World Wide Web Consortium, an organization which regulates standards for the Internet, and each version of HTML has a set of definitions. Note that HTML is not a programming language. While we often refer to HTML markup as HTML code, a programming language requires the processing of logical statements and math. HTML allows the developer to make text documents look engaging and pleasant. In most cases, programming on an HTML document is done with JavaScript.

Types of HTML

The most common version of HTML in use is HTML 4. The new version of HTML, which is entering the industry, is HTML 5. HTML can be divided into three categories: transitional, strict, and frameset. These types apply to how HTML is used, not necessarily to the selection of tags.

Transitional

The transitional type is the most common type of HTML. It has a flexible syntax. Over the years, the transitional HTML has been used without syntax restrictions, and browsers support 'best effort' approach to reading the tags. If tags are misspelled, the browsers do not correct web developers' errors, and they display content anyway. Browsers do not report HTML errors - they simply display what they can. This is the 'best effort' concept.

Strict

The strict type of HTML is meant to return rules into HTML and make it more reliable. For example, the strict type requires closing tags for all opened tags. This style of HTML is important on phones, where the processing power may be limited. A clean and error-free code helps to load pages faster.

Frameset

Finally, frameset allows web developers to create a mosaic of HTML documents. Multiple documents can be connected into a single screen. This technique is often used to create a menu system. You click on a menu item on the left side of the screen, and only the right side of the screen re-loads. The menu stays in place.

HTML Examples

Let's take a look at a few examples. To execute the examples, simply create a text document on your desktop called 'test.html'. If you are using a Notepad program, please make sure the extension on the file is .html, not 'test.html.txt'. To do this, use 'Save As' in Notepad and then include in a double-quote as the name of the file 'test.html'. On your desktop, you will see an icon with 'test' as the name, and the picture on the icon will have a web browser association.

Stay tuned on www.olalekanakeem.blogspot.com to be continued soon. for the benefit of nd2 computer science students, Federal Polytechnic Ede Osun State Nigeria 

Object Oriented Programming: Objects, Classes & Methods

Instructor: Paul Zandbergen Paul has a PhD from the University of British Columbia and has taught Geographic Information Systems, statistics and computer programming for 15 years.


What Is an Object in Programming?

Object-oriented programming, or OOP, is an approach to problem solving where all computations are carried out using objects. An object is a component of a program that knows how to perform certain actions and how to interact with other elements of the program. Objects are the basic units of object-oriented programming. A simple example of an object would be a person. Logically, you would expect a person to have a name. This would be considered a property of the person. You could also expect a person to be able to do something, such as walking or driving. This would be considered a method of the person.
Code in object-oriented programming is organized around objects. Once you have your objects, they can interact with each other to make something happen. Let's say you want to have a program where a person gets into a car and drives it from A to B. You would start by describing the objects, such as a person and car. That includes methods: a person knows how to drive a car and a car knows what it is like to be driven. Once you have your objects, you bring them together so the person can get into the car and drive.

Classes and Objects

A class is a blueprint of an object. You can think of a class as a concept, and the object is the embodiment of that concept. You need to have a class before you can create an object. So, let's say you want to use a person in your program. You want to be able to describe the person and have the person do something. A class called 'person' would provide a blueprint for what a person looks like and what a person can do. To actually use a person in your program you need to create an object. You use the person class to create an object of the type 'person.' Now you can describe this person and have it do something.
Classes are very useful in programming. Consider the example of where you don't want to use just one person but 100 people. Rather than describing each one in detail from scratch, you can use the same person class to create 100 objects of the type 'person.' You still have to give each one a name and other properties, but the basic structure of what a person looks like is the same.

Methods and Functions

Once you have created objects, you want them to be able to do something. This is where methods come in. A method in object-oriented programming is a procedure associated with a class. A method defines the behavior of the objects that are created from the class. Another way to say this is that a method is an action that an object is able to perform. The association between method and class is called binding. Consider the example of an object of the type 'person,' created using the person class. Methods associated with this class could consist of things like walking and driving. Methods are sometimes confused with functions, but they are distinct.
A function is a combination of instructions that are combined to achieve some result. A function typically requires some input (called arguments) and returns some results. For example, consider the example of driving a car. To determine the mileage, you need to perform a calculation using the distance driven and the amount of fuel used. You could write a function to do this calculation. The arguments going into the function would be distance and fuel consumption, and the result would be mileage. Anytime you want to determine the mileage, you simply call the function to perform the calculation.
How does this differ from a method? A function is independent and not associated with a class. You can use this function anywhere in your code, and you don't need to have an object to use it.
Now, what if you were to associate the function with an object of the type 'car?' For example, you want to be able display the mileage of the car on the dashboard. In this case, the mileage calculation has become a method because it is a procedure associated with the car's class. Every time you create a new object of the type 'car' using the car class, this method will be part of the object. The action the car is now able to perform is to calculate mileage. It is the same calculation as performed by the stand-alone function but is now bound to the car.

OOP Concepts

Object-oriented programming is built around a number of concepts. These concepts are implemented using classes, objects and methods, but it is useful to review those concepts more generally. Four core concepts of object-oriented programming are abstraction, encapsulation, inheritance and polymorphism.
Using abstraction, a programmer hides many of the details about an object and shows only the most relevant information. This reduces complexity and increases efficiency. For example, in the case of a person, there could be any number of detailed descriptions. However, if only the name and age are really relevant in a particular context, only those descriptions will be used.


Stay tuned on www.olalekanakeem.blogspot.com to be continued soon. for the benefit of nd2 computer science students, Federal Polytechnic Ede Osun State Nigeria

 

Cobol Programming

What is COBOL Programming? - History & Examples

Instructor: Alisa Perry Alisa has taught college Computer Technology and has a master's degree in Computer Science.
The programming language COBOL has been around since the 1950's, though by the changing standards of technology it was considered to be old news by the 1980's. Still, the programming language continues to be used today and shows no signs of fading away anytime soon. This lesson will take a brief look at the history, resiliency and continued revelance of COBOL.

COBOL Language Defined

COBOL is a programming language that reads like regular English and is often used for business and administrative purposes. The name means Common Business Oriented Language . COBOL is referred to as a legacy language, which means it is in a format that is no longer used or supported by new systems. But, COBOL is critical to the success of many companies and so has stuck around even as technology has moved forward.

History of COBOL

COBOL has been around since 1959, when it was developed by the Conference on Data Systems Languages (CODASYL). It was one of the first high-level programming languages created. COBOL is run on the mainframe as well as on the PC.
It was during the 1980's that some small businesses moved some of their mainframe COBOL programs to PC. But, this was no simple task. In the 1990's, COBOL was widely considered a thing of the past. It was obsolete, mainly because technology was becoming more object-oriented and moving away from the mainframe. However, COBOL wasn't left behind completely. It was still used by banks and other major corporations who depend heavily on accuracy and the stability of their programs to keep their companies running. COBOL worked as many of them wanted it to for the most part. When hit with the idea of migration to new languages, they found that many of their COBOL programs were quite large and difficult to migrate. So, as many corporations prepared for year 2000, they upgraded their COBOL programs to run well beyond 2000 versus changing over to a new languages.

Programming in COBOL

To begin writing a COBOL program, you need a compiler and a location to write the program. You can write COBOL programs in text editors like Notepad or Notepad++. Once it is written, the program must be compiled to check for errors and converted into a language that the computer can read.

Divisions of COBOL

The first thing to understand is that COBOL is divided into four divisions. The divisions are created in the program in this order:
  1. Identification Division
  2. Environment Division
  3. Data Division
  4. Procedure Division
Stay tuned on www.olalekanakeem.blogspot.com to be continued soon. for the benefit of nd2 computer science students, Federal Polytechnic Ede Osun State Nigeria

 

Brief History of Microsoft

History of Microsoft

The name Microsoft was created from the word microcomputer and software, because software was programmed in microcomputer. Nobody Knew that one day this name would create a History into the world of computers.

Microsoft was founded by Bill Gates; He was born to William Henry Gates III & Mary Gates on Oct 28, 1955. Little did they know that one its going to create History in the world of computers, His father was a Seattle attorney and Mother was a schoolteacher in University of Washington, He went to Lakeside Prep School, In Early school days Bill Gates was the topper of the class for most of the years, but especially in math’s and science. In 1968, he was introduced to computers.
15Bill gates and his friend Paul Allen use to skip Classes, and were spending more time in computer room, they started to find out how these computers work, and read books about them, and also started to write programs. Sooner they started to find many loop holes and learnt to hack it, but they were banned from the computer room because they had crashed some important files.  He started to write programs for the computers at the age of 13, and still holds that position as one of the youngest and smartest programmer ever this world had witnessed.
Sooner their time changed as they were hired by a company to explore weaknesses in their system to tighten the security loop holes, But the company never payed them money instead they allowed them to use the computer anytime they wish. After finishing there schooling days they had joined Harvard University. This was the time when gates got into full time into the world of computers.
CREATION OF MICROSOFT
Within couple of weeks they were hired by another company for writing programs for them, the company was Information Sciences Inc. This time they payed them and also gave them access to the computer full time. By this time they were famous in the city, so they gained many contracts for many company’s, who told them to fix the bugs, and to write the programs for them, this jobs helped them to explorer deeper into the computer world and to the world of programming, they even made good money out of it, and also gained knowledge about it.
He was not graduated from Harvard University, because of his total interest in programming; he spent most of his time in computer center. Allen and Gates used to think about opening their future company.

Stay tuned on www.olalekanakeem.blogspot.com to be continued soon. for the benefit of nd2 computer science students, Federal Polytechnic Ede Osun State Nigeria