What Is Software?

SoftwareAs opposed to "hardware," meaning the physical parts of computers. The suffix "-ware" is used quite a bit in the computer world. is often synonymous with the terms program and application (or "app""App" is sometimes used to describe a small program, but can be used for any program.). All three refer to a list of commands which the computer performs. Of the three terms, software is perhaps the most general, as it can include anything, including the Operating System. The other two terms, programs and applications, more commonly refer to individual pieces of software which run within the framework of the larger operating system. In this chapter, however, I will use the terms software, programs, and applications interchangeably.

OK, So What Is a Program?

A program is very much like a cooking recipe: it is a list of commands which the computer carries out. When you pick up a recipe, you see a list of instruction which you will then follow in sequence. That's exactly what a computer does.

Applications are written using a programming language, such as C++, Java, or PHP. This may be differentiated from markup languages such as HTML, which are not strictly programming languages, although they share some cosmetic similarities.

Most people will recognize a program as being something that is called an executable"execute" means to "do" or "perform" some task; this is the origin of the ".exe" filename extension., which is essentially a stand-alone program which you can double-click and then the program runs. An executable runs directly within the operating system. Other languages may be parsed by another program; for example, this web page is in HTML with PHP, but it is not an executable; instead, the browser you are using parses the code I have written. In other words, parsed languages must run within a program which runs within the operating system.

The most plain program one could write is called "Hello World!" and is nothing more than a command to tell the computer to print the simple expression "Hello World!" For example, this is what it looks like in BASICBeginner's All-purpose Symbolic Instruction Code, a programming language designed for simplicity, so that beginners could easily use it:

10 PRINT "Hello World!"
20 END

As you can see, it is indeed very plain--but it is a program which the computer will execute. In this case, it simply does a pre-assigned task and then ends.

Programs may also get input, or information from the user. This information is usually stored in a variable, a name which the computer uses to refer to a specific piece of data. For example, here is another BASIC program:

10 INPUT "What is your name?", N$
20 PRINT "Hello "; N$
30 INPUT "Would you like me to ask you a question? (Y/N)", A$
40 IF A$ = "N" OR A$ = "n" THEN GOTO 80
50 IF A$ = "Y" OR A$ = "y" THEN GOTO 10
60 PRINT "Sorry, I did not understand your answer. Please type Y or N."
70 GOTO 30
80 PRINT "Okay, Bye!"
90 END

In the above program, the following steps are taken:

  1. The computer asks the user for a name, and waits for input;
  2. When the user types something and hits "Enter," the computer assigns the input to the variable N$;
  3. The computer then greets the user with "Hello" and the user's name;
  4. The computer asks if it should ask a question, and waits for input;
  5. The computer then checks the answer:
  6. If the answer is "N" or "n" (for "No"), then it jumps to the end; otherwise it continues;
  7. If the answer is "Y" or "y" (for "Yes"), then it jumps back to the beginning question; otherwise it continues;
  8. If the answer is neither "Y" nor "N", then line 50 will catch the error, tell the user it does not understand the answer, and sends the user back to line 30 to ask the question again.

This program contains a few loops, which send the user back to repeat a section of the program again and again, unless the user gives the correct input to escape the loop and end the program.

In the table below, there is a slightly more complex program, but still very simple. This one is written in C++, a language commonly used to create executable programs. If you decide to take more Computer Science classes, especially in programming, you will almost certainly learn this language.

This particular application is a currency conversion program; it has the conversion rates for dollars to yen and dollars to euros, asks the user to enter how many dollars they wish to exchange, and then returns the number of yen and euros that number equals.

The blue portion on the left is the actual program; the computer will read it from the top and perform all commands until it reaches the end. Note: You will not need to understand C++, BASIC, or any of the specific programming commands for the test in this class, but you should recognize the terms to describe their parts.

Program code Explanation
#include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;
These are like the "ingredients" list in a recipe; they tell the computer which commands will be used in the program. In this case, "iostream" means that there will be text input and output; "iomanip" means text formatting; and "cmath" means mathematical commands will be used.
int main () { This is the beginning of a function. A function is a series of commands in a group which perform a specific task. This one is called "main" and returns an integer. It begins with { and ends below with }.
const float YEN = 85.87;
const float EURO = 0.766;
float dollar, yenrate, eurorate;
These define constants and variables, which are names which contain values. For example, whenever the name "YEN" is mentioned, it will always be "85.87". A constant never changes; a variable can be changed often. "Float" describes the kind of number it contains.
cout << "How many dollars will we be exchanging today?\n\n";
cin >> dollar;
These are commands. "cout" means to print out a message to the user; "cin" means to receive information from the user. This asks the user for the number of dollars to be exchanged, and saves the number in the variable "dollar". The << and >> marks show the direction of data, in or out.
yenrate = dollar * YEN;
eurorate = dollar * EURO;
These are mathematical operations which take the number of dollars and converst them into yen and euros.
cout << setprecision(2) << showpoint << fixed; This sets how the data will be displayed (e.g., how much space they take, how many decimal places)
cout << "$" << dollar << " = " << "¥" << setw(8) << yenrate << endl;
cout << "$" << dollar << " = " << "£" << setw(8) << eurorate << endl;
These commands print out the amounts in yen and euros according to how many dollars the user specified.
return 0;
}
This is the end of the program. When the program returns a value of "0", the program ends. The right-bracket shows the end of the function "int main ()" which started near the top.

Most executable programs are written in "higher-level""high-level" languages are languages that are easier for humans to read and understand; "low-level" languages are ones which are more efficient and easier for computers to process. programming languages, such as C++, but are then compiled, using a program called a compiler; when a program is compiled, it is checked for incorrect language use, and is translated into a "lower-level" language that the computer can more easily access.