Computer Programming
Computer Programming
I. Specify task
ii. Write the algorithm for the solution to the problem
iii. Write computer program (code) corresponding to the algorithm
PROGRAMMING TOOLS
The two main ways in which you give instructions or commands to the computer is by using an interpreter and
the other a compiler.
✓ Compiler is a special program which translates program written in high level languages into
machine language. The original program is called source program and its translation is
called object source. With compilers you write your code in a file(s) using an editor. You then
run the compiler and see if it accepts your program. Compiled languages include; Pascal, C++, C,
Fortran.
✓ Interpreter: It converts one instruction into a machine code and then executes it before going
to the next instruction while a compiler converts the entire program from a high-level language
The operators can be prefix or postfix. In the statement, k=i++, the operators ++ is postfix. Therefore, the
value of i is assigned to k before it is incremented. In the statement, l=++j the operator is prefix. In this case, the
value of j is incremented before been assigned to l.
3. LOGICAL OR BOOLEAN OPERATORS
They can be used to compare more than 2things. A Boolean consists of operators such as: AND, OR, NOT,
XOR.
Boolean expressions are expressions that result in the value of either true or false.
❖ An assignment statement is an instruction for assigning a value to a variable.
Fundamental Control Structures
Control structures specify the order in which a computer will execute each line of software code. Control
structures enable the computer to read codes where there are choices and iterations (loops).
1) Sequence / Sequential control structure:
Here, a computer performs each line of software code in the order it appears.
Instruction 01
Instruction 02
Instruction 03
Instruction n
There is a 1st instruction,
Then, a 2nd instruction,
A 3rd instruction
To the last instruction In the sequence
ii.
Syntax error: They are mistakes in a software code’s grammar. They include;
Run time error: There are mistakes that occur when you run the software code. It
iii.
occurs when program directs computer to perform illegal operations.
o Undeclared variables
o Missing semi-colon at the end of the statement
o Comments not closed
Example 1:
<html>
<head>
<title>My First Web Page</title>
</head>
<body>
<strong>This text is bold</strong><br>
<b>This text is bold too</b><br>
<em>This text is in italics</em><br>
<i>This text is in italics too</i><br>
<u>This text is underlined</u><br>
<b><i>This text is bold and in italics</i></b><br>
<strong><em><u>This text is bold, underlined and in italics</u></em></strong>
</body>
Microcontrollers are particularly used in embedded systems for real-time control applications with
on-chip program memory and devices.
Microprocessor vs Microcontroller
Let us now take a look at the most notable differences between a microprocessor and a
microcontroller.
Microprocessor Microcontroller
Microprocessors are multitasking in nature.
Can
perform multiple tasks at a time. For example,
Single task oriented. For example, a washing
on
machine is designed for washing clothes only.
computer we can play music while writing text
in
text editor.
RAM, ROM, I/O Ports, and Timers can be
RAM, ROM, I/O Ports, and Timers cannot be
added
added externally. These components are to be
externally and can vary in numbers.
CLOUD COMPUTING
Simply put, cloud computing is the delivery of computing services—including servers, storage,
databases, networking, software, analytics, and intelligence—over the Internet (“the cloud”) to offer
faster innovation, flexible resources, and economies of scale. You typically pay only for cloud
services you use, helping you lower your operating costs, run your infrastructure more efficiently,
and scale as your business needs change.
Top benefits of cloud computing
Cloud computing is a big shift from the traditional way businesses think about IT resources. Here
are seven common reasons organizations are turning to cloud computing services:
Cost
Cloud computing eliminates the capital expense of buying hardware and software and setting up
and running on-site datacenters—the racks of servers, the round-the-clock electricity for power
and cooling, and the IT experts for managing the infrastructure. It adds up fast.
Speed
Most cloud computing services are provided self service and on demand, so even vast amounts of
computing resources can be provisioned in minutes, typically with just a few mouse clicks, giving
businesses a lot of flexibility and taking the pressure off capacity planning.
Global scale
The benefits of cloud computing services include the ability to scale elastically. In cloud speak, that
means delivering the right amount of IT resources—for example, more or less computing power,
storage, bandwidth—right when they’re needed, and from the right geographic location.
Productivity
On-site datacenters typically require a lot of “racking and stacking”—hardware setup, software