DOC PREVIEW
UCR CS 5 - Chapter 1 Intro to Computing

This preview shows page 1-2-21-22 out of 22 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 22 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 22 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 22 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 22 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 22 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Chapter 1 – Intro to ComputingSlide 2Slide 3Slide 4Slide 5Slide 6Slide 7Slide 8Slide 9Slide 10Slide 11Slide 12Slide 13Slide 14Slide 15Slide 16Slide 17Slide 18Slide 19Slide 20Slide 21Slide 22The Visual Basic Coach - 2002Chapter 1 – Intro to Computing1.1 Types of Languages and Why They Are Useful Computers require a method of instruction to operate. Modern computers get their instructions from programming languages.A programming language is an agreed-upon format of symbols that enables a programmer to instruct a computer to perform certain predefined tasks.There are two types of languages depending on how understandable they are: high- and low-level languages.The Visual Basic Coach - 2002Chapter 1 – Intro to ComputingThe Development of Programming Languages Manual switches using binary numbersAssembly language and punch cards – two early breakthroughsCOBOL and FORTRAN – allowed programs to be run on another system than the originalPL/1 – result of one of the quests for a single universal language for all needsC – originally used for developing operating systems, but became very popularC++ and other object-oriented languages – enabled creation of reusable programsJava – like C++, but can be run on any computer without recompilingThe Visual Basic Coach - 2002Chapter 1 – Intro to Computing1.2 Where Does Visual Basic .NET Fit In? Visual Basic .NET has its roots in a language called BASIC which was− Developed in 1964 to help nonscientists develop computer programs− Quite limited in functionality− Difficult to use for large, integrated systemsThe Visual Basic Coach - 2002Chapter 1 – Intro to ComputingFeatures of Visual Basic .NET Visual Basic .NET is quite different from the original BASIC− Complete development enivronment −Primarily meant for developing prototypes and front ends for database applications.− Truly object-oriented− Part of the larger world of the .NET framework, which provides the same development environment and contains the same object model. It is fairly easy to switch between different languages within the framework. Objects developed in any of the .NET languages can be accessed in the others.The Visual Basic Coach - 2002Chapter 1 – Intro to Computing1.3 What Makes a Quality Program? A quality program should have all of the following characteristics:− Readability− Modularity− Efficiency− Robustness− UsabilityThe Visual Basic Coach - 2002Chapter 1 – Intro to ComputingReadability It is imperative that the program be written so that other programmers as well as the original programmer can understand it since the maintenance phase of a computer project can actually be more expensive than the original development process.A key method a programmer can employ is to add comments to the program which explain the program’s purpose and any unclear pieces of code. It is also often necessary to produce external documentation.A programmer who can produce readable, reliable code is valuable to a company and is less likely to get stuck with maintaining cryptic code.Programming standards/conventions are very important, especially when a group of programmers work together.The Visual Basic Coach - 2002Chapter 1 – Intro to ComputingModularity Programs should be written in an orderly fashion with problems divided into smaller subproblems and then assembled in a logical order.The Visual Basic Coach - 2002Chapter 1 – Intro to ComputingEfficiency Visual Basic .NET is not usually used when high performance is the key design criteria.Program size of the program itself is usually not an issue due to declining computer memory prices and the large size of the .NET framework itself. If you are improving efficiency of your VB .NET application, you are most likely adding complexity without adding value to the application.If you do decide to add cryptic lines for the purposes of speed and/or size, make sure to document them and include a simpler way for others to easier understand your code.The Visual Basic Coach - 2002Chapter 1 – Intro to ComputingRobustness A program should gracefully handle cases when the input to it is not as expected or some other error has occurred. A program should never crash.The Visual Basic Coach - 2002Chapter 1 – Intro to ComputingUsability A program must meet the needs of the end user, i.e. be correct, in order to be useful.The Visual Basic Coach - 20021.4 Understanding Algorithms An algorithm is a detailed sequence of steps required to solve a problem.Algorithms can be represented in a graphical format called a flowchart. Flowcharts can be large, but they are often useful.Chapter 1 – Intro to ComputingUsed to represent calculations and data manipulation.Used to represent a comparison with either a Yes/True result or a No/False result.Used to represent the input or output of data.Used to indicate the beginning or ending of a task.These connector lines are used to join the other symbols within the flowchart. The second and third ones are used in conjunction with a Decision Box.The Visual Basic Coach - 2002Chapter 1 – Intro to ComputingAn Example AlgorithmStep 1: Turn the stereo on.Step 2: If the band is set to FM, switch it to AM.Step 3: If the station is set to a station greater than 610, turn the station to the left until 610 is reached.Step 4: If the station is set to a station less than 610, turn the station to the right until 610 is reached.Step 5: Listen to the best sports talk station in the country.The Visual Basic Coach - 2002Chapter 1 – Intro to ComputingThe flowchart of the example algorithm:The Visual Basic Coach - 2002Chapter 1 – Intro to Computing1.5 Top-Down Versus Even-Driven Algorithms Top-down or sequential problems are solved by traditional programming languages. They lend themselves to problems that have a starting point, a predetermined series of steps, and an ending point.Algorithms that respond to external stimuli like clicking a mouse or selecting an item from a pull-down menu are considered event-driven.The Visual Basic Coach - 2002Chapter 1 – Intro to ComputingConsider the steps required to boil an egg.Step 1: Open closet door.Step 2: Remove pot.Step 3: Close closet door.Step 4: Place pot under sink faucet.Step 5: Turn on the cold water.Step 6: Wait until the pot is ¾ full.Step 7: Turn off the cold water.Step 8: Place pot on stove burner.Step 9: Turn burner on high heat.Step 10: Open refrigerator door.Step 11: Take out the egg carton.Step 12: Open


View Full Document

UCR CS 5 - Chapter 1 Intro to Computing

Download Chapter 1 Intro to Computing
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Chapter 1 Intro to Computing and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Chapter 1 Intro to Computing 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?