Sunteți pe pagina 1din 14

SOFTWARE

CS 1308 Computer Literacy and The Internet

From Hardware to Software


We know what a computer looks like and how it

works. We have looked at machine language programming.


Low level (because it is more closely tied to the hardware)

Now we need to look at a more reasonable way of

programming. Why are we looking at programming?

Chances are you will never write a program. It is very likely that at some point you will help gather

requirements for somebody else as a expert in your area. The more you know about their process, the more help you can be in getting what you want.

How do we get the computer to help us? Write software.


Figure out what problem we are trying to solve Often the hardest part! Solve the problem If you cant solve the problem, you cant tell a computer how to solve it. Ask questions Look for familiar things (patterns) Divide and conquer Create an algorithm from your solution Write the software Assume the low-level circuits and hardware work Test the software

Ask Questions...
to understand the problem
What do I know about the problem? What is the information that I have to process in

order the find the solution?


What does the solution look like? What sort of special cases exist? How will I recognize that I have found

the solution?

Look for Familiar Things


You should never reinvent the wheel
In computing, you see certain problems again

and again in different guises A good programmer sees a task, or perhaps part of a task (a subtask), that has been solved before and plugs in the solution

Divide and Conquer


Break up a large problem into smaller units that we can handle
Applies the concept of abstraction

The divide-and-conquer approach can be applied

over and over again until each subtask is manageable

Algorithms
Algorithm A set of instructions for solving a problem or subproblem in a finite amount of time using a finite amount

of resources The instructions must be unambiguous

The Interactions Between Problem-Solving Phases

Sample Algorithm

Examples of computer languages


The if statement allows the program to test the state

of the program variables using a Boolean expression

Compilers
Compiler A program that translates a highlevel language program into machine code
High-level languages provide a richer set of

instructions that makes the programmers life even easier

Compilers

Figure 8.1 Compilation process

When does the all the work happen?


The coding and testing are the smallest parts of the software lifecycle.
The longest is Maintenance.

Software may take a year to write, but it may be out in the field for 10-20 years!

Review
Computers need software
You have to know what problem to solve and

be able to solve it. We typically write programs in a high level language and use other programs to translate them into a specific machine language. Software will need updates and bug fixes for as long as it is being used. And that can be a long time.

S-ar putea să vă placă și