Section 1.1. An Introduction to Computers


[Page 2]

1.1. An Introduction to Computers

An Introduction to Programming Using Visual Basic 2005 is a book about problem solving using computers. The programming language used is Visual Basic 2005 (hereafter shortened to Visual Basic), but the principles taught apply to many modern programming languages. The examples and exercises present a sampling of the ways that computers are used in society.

Computers are so common today that you certainly have heard some of the terminology applied to them. Here are some questions that you might have about computers and programming.

Question: What is meant by a "personal" computer?

Answer: The word "personal" does not mean that the computer is intended for personal, as opposed to business, purposes. Rather, it indicates that the machine is operated by one person at a time instead of by many people.

Question: What are the main components of a personal computer?

Answer: Hidden from view inside the system unit are several components, including the microprocessor, memory, and hard drive of the computer. The central processing unit (CPU), sometimes referred to as the microprocessor, can be thought of as the computer's brain, which carries out all of the computations. The memory, often referred to as random access memory (RAM), stores instructions and data while they are being used by the computer. When the computer's power is turned off, the contents of memory are lost. A hard disk drive is used to store instructions and data when they are not being used in memory and when the computer is turned off. Inside the system unit there are also device cards, such as a graphics card, sound card, network card, and a modem. A graphics card is used to send an image to the monitor, and a sound card is used to send audio to a set of speakers attached to the computer. Network cards can be used to connect to a local area network (LAN) of computers, while a modem uses a telephone line to connect to any computer that can be reached by a phone call.

The personal computer also has several input and output devices, which are used to communicate with the computer. Standard input devices include the keyboard and mouse. Standard output devices include the monitor and printer. Instructions are entered into the computer by typing them on the keyboard, clicking a mouse, or loading them from a file located on a disk drive or downloaded from a network. Information processed by the computer can be displayed on the monitor, printed on the printer, or recorded on a disk drive.

Question: What are some uses of computers in our society?

Answer: The dramatic decrease in the cost of hardware and software technology has made computers widely available to consumers and corporations alike. Whenever we make a phone call, a computer determines how to route the call and calculates the cost of the call. Banks store all customer transactions on computers and process these transactions to revise the balance for each customer. Airlines record all reservations with computers. This information, which is stored in a database, can be accessed to determine the status of any flight. NASA uses computers to calculate the trajectories of satellites. Business analysts use computers to create pie and bar charts that give visual impact to data. With the Internet connecting millions of home computers, families and friends can exchange messages, information, and pictures. Consumers can shop from their PCs. Virtually no aspect of modern life is untouched by computer technology.


[Page 3]

Question: What are some topics covered in this text that students could use immediately?

Answer: Computer files can be created to hold lists of names, addresses, and phone numbers, which can be alphabetized and displayed in their entirety or selectively. Mathematical computations can be carried out for science, business, and engineering courses. Personal financial transactions, such as bank deposits and loans, can be recorded, organized, and analyzed.

Question: How do we communicate with the computer?

Answer: Many languages are used to communicate with the computer. At the lowest level, there is machine language, which is understood directly by the microprocessor, but is awkward for humans. Visual Basic is an example of a higher-level language. It consists of instructions to which people can relate, such as Click, If, and Do.

Question: How do we get computers to perform complicated tasks?

Answer: Tasks are broken down into a sequence of instructions that can be expressed in a computer language. (This text uses the language Visual Basic.) This sequence of instructions is called a program. Programs can range in size from two or three instructions to millions of instructions. Instructions are typed on the keyboard, or read in from a file on a disk, and stored in the computer's memory. The process of executing the instructions is called running the program.

Question: What is a server?

Answer: Whether a computer is a server depends on how it is being used. A computer that is only used by one person is a computer. A server is a computer that provides resources such as files, printers, or Internet access to other computers. Since a server needs to be continuously available to other computers, additional components are usually added to it to increase its reliability in the event of a power failure or other unexpected event.

Question: Are there certain features that all programs have in common?

Answer: Most programs do three things: take in data, manipulate them, and give desired information. These operations are referred to as input, processing, and output. The input data might be held in a portion of the program, reside on a disk drive, or be provided by the computer operator in response to requests made by the computer while the program is running. The processing of the input data occurs inside the computer and can take from a fraction of a second to many hours. The output data are either displayed on the monitor, printed on the printer, or recorded on a disk. As a simple example, consider a program that computes sales tax. An item of input data is the cost of the thing purchased. The processing consists of multiplying the cost by a certain percentage. An item of output data is the resulting product, the amount of sales tax to be paid.

Question: What are the meanings of the terms "hardware" and "software?"

Answer: Hardware refers to the physical components of the computer, including all peripherals, the central processing unit, disk drives, and all mechanical and electrical devices. Programs are referred to as software.


[Page 4]

Question: What are the meanings of the terms "programmer" and "user?"

Answer: A programmer is a person who solves problems by writing programs on a computer. After analyzing the problem and developing a plan for solving it, he or she writes and tests the program that instructs the computer how to carry out the plan. The program might be run many times, either by the programmer or by others. A user is any person who uses a program. While working through this text, you will function both as a programmer and as a user.

Question: What is meant by problem solving?

Answer: Problems are solved by carefully reading them to determine what data are given and what outputs are requested. Then a step-by-step procedure is devised to process the given data and produce the requested output. This procedure is called an algorithm. Finally, a computer program is written to carry out the algorithm. Algorithms are discussed in Section 2.2.

Question: What types of problems are solved in this text?

Answer: Carrying out business computations, creating and maintaining records, alphabetizing lists, and displaying tabular data are some of the types of problems we will solve.

Question: How did Visual Basic 2005 evolve?

Answer: In the early 1960s, two mathematics professors at Dartmouth College developed BASIC to provide their students with an easily learned language that could tackle complicated programming projects. As the popularity of BASIC grew, refinements were introduced that permitted structured programming, which increases the reliability of programs. Visual Basic 1.0 is a version of BASIC developed in 1991 by the Microsoft Corporation to allow easy, visual-oriented development of Windows applications. Visual Basic 2005 is a language similar to the original Visual Basic, but more powerful. It is targeted for what is known as the .NET run time, which is a program that executes Visual Basic 2005 as well as programs from other languages that are targeted for the .NET run time. This will ultimately allow programs written in Visual Basic to be run on devices other than computers, such as cell phones and handheld devices. Other features of Visual Basic include full object-oriented programming capabilities and the development of Web services. Object-oriented programming is discussed in Chapter 11. The techniques presented in this book can be applied to the development of Web services.




An Introduction to Programming Using Visual Basic 2005
Introduction to Programming Using Visual Basic 2005, An (6th Edition)
ISBN: 0130306541
EAN: 2147483647
Year: 2006
Pages: 164

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net