Ch_01
22 Pages

Ch_01

Course Number: CS 901, Fall 2009

College/University: CSU Fullerton

Word Count: 8089

Rating:

Document Preview

1 An Overview of Computers and Programming Languages In this chapter, you will: different types of computers Learn abouthardware and software components of a Explore thesystem computer of a computer Learn about the language of programming languages Learn about the evolution Examine high-level programming languages Discover what a compiler is and what it does Examine how a high-level language program is...

Unformatted Document Excerpt
Coursehero >> California >> CSU Fullerton >> CS 901

Course Hero has millions of student submitted documents similar to the one
below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.

Course Hero has millions of student submitted documents similar to the one below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.

Overview 1 An of Computers and Programming Languages In this chapter, you will: different types of computers Learn abouthardware and software components of a Explore thesystem computer of a computer Learn about the language of programming languages Learn about the evolution Examine high-level programming languages Discover what a compiler is and what it does Examine how a high-level language program is processed Learn what an algorithm is and explore problem-solving techniques aware of structured design and Becomeprogramming methodologies object-oriented design Become aware of Standard C++ and ANSI/ISO Standard C++ Copyright 2004 by Course Technology. All rights reserved.This publication is protected by federal copyright law. No part of this publication may be reproduced without prior permission in writing from Course Technology. Some of the product names and company names have been used for identification purposes only and may be trademarks or registered trademarks of their respective manufactures and sellers. 2 Chapter 1 An Overview of Computers and Programming Languages INTRODUCTION Today we live in an era where information is processed almost at the speed of light.Through computers, the technological revolution is drastically changing the way we live and communicate with one another.Terms such as "the Internet," which was unfamiliar just a few years ago, are very common today.With the help of computers you can send letters to, and receive letters from, loved ones within seconds.You no longer need to send a rsum by mail to apply for a job; in many cases you can simply submit your job application via the Internet. You can watch how stocks perform in real time, and instantly buy and sell them. Students regularly "surf " the Internet and use computers to design their classroom projects.They also use powerful word processing software to complete their term papers. Many people maintain and balance their checkbooks on computers. These examples are some of the ways that computers have greatly affected our daily lives. They are all made possible by the availability of different software, which are computer programs. For example, word processing software is a program that enables you to write term papers, create impressive looking rsums, and even write a book. This book, for example, was created with the help of a powerful word processor.Without software a computer is of no use. However, software is developed with the help of programming languages. The programming language C++ is especially well suited for developing software to accomplish a specific task. Until the early 1990s, before beginning to teach a programming language course, instructors spent the first few weeks just teaching their students how to use computers. Today, by the time students graduate from high school, they know very well how to work with a computer. This book is not concerned with explaining how to use computers. Rather, it teaches you how to write programs in the language called C++. It is useful, however, to at least understand some of the basic terminology and different components of a computer before you begin programming. This chapter briefly describes the main components of a computer system, the history and evolution of computer languages, and some fundamental ideas about how to solve problems with computer programming. A BRIEF OVERVIEW OF THE HISTORY OF COMPUTERS In the 1950s, computers were large devices accessible only to a very few people.All work-- including surgery, accounting, word processing, and calculations among other tasks--was done without the aid of computers. In the 1960s, multimillion-dollar computers emerged, and only large companies were able to afford them.These computers were very large in size, Copyright 2004 by Course Technology. All rights reserved.This publication is protected by federal copyright law. No part of this publication may be reproduced without prior permission in writing from Course Technology. Some of the product names and company names have been used for identification purposes only and may be trademarks or registered trademarks of their respective manufactures and sellers. Elements of a Computer System 3 and only computer experts were allowed to use them. During the mid-1970s, computers became cheaper and smaller. By the mid-1990s, people from all walks of life were able to afford them. During the late 1990s, small computers became even less expensive and much faster.Although several categories of computers exist, such as mainframe, midsize, and micro, all computers share some basic elements. 1 ELEMENTS OF A COMPUTER SYSTEM A computer is an electronic device capable of performing commands.The basic commands that a computer performs are input (get data), output (display result), storage, and performance of arithmetic and logical operations. In today's market, personal computers are sold with descriptions such as Pentium 4 Processor 2.66 GHz, 512MB RAM, 100GB HD, 19-inch SVGA monitor and come with preloaded software such as operating systems, games, encyclopedias, and application software such as word processors or money management programs. These descriptions represent two categories: hardware and software. Items such as "Pentium 4 Processor 2.66 GHz, 512MB RAM, 100GB HD, 19-inch SVGA monitor" fall into the hardware category; items such as "operating systems, games, encyclopedias, and application software" fall into the software category. Let's look at the hardware first. Hardware Major hardware components include the following: central processing unit (CPU); main memory (MM), also called random access memory (RAM); input/output devices; and secondary storage. Some examples of input devices are the keyboard, mouse, and secondary storage. Examples of output devices are the screen, printer, and secondary storage. Let's look at each of these components in more detail. Central Processing Unit The central processing unit (CPU) is the brain of the computer and the single most expensive piece of hardware in your personal computer. The more powerful the CPU, the faster the computer.The main components of the CPU are the control unit (CU), arithmetic logic unit (ALU), and registers. Figure 1-1 shows how certain components of the CPU fit together. Copyright 2004 by Course Technology. All rights reserved.This publication is protected by federal copyright law. No part of this publication may be reproduced without prior permission in writing from Course Technology. Some of the product names and company names have been used for identification purposes only and may be trademarks or registered trademarks of their respective manufactures and sellers. 4 Chapter 1 An Overview of Computers and Programming Languages Central Processing Unit (CPU) Control Unit (CU) Instruction Register (IR) Program Counter (PC) . . . Input Device Output Device Arithmetic Logic Unit (ALU) . . . Main Memory Secondary Storage Figure 1-1 Hardware components of a computer The control unit (CU) has three main functions: fetch and decode the instructions, control the flow of information (instructions or data) in and out of main memory, and control the operation of the CPU's internal components. The arithmetic logic unit (ALU) carries out all arithmetic and logical operations. The CPU contains various registers. Some of these registers are for special purposes. For example, the instruction register (IR) holds the instruction currently being executed.The program counter (PC) points to the next instruction to be executed.All registers provide temporary storage. Main Memory Main memory is directly connected to the CPU. All programs must be loaded into main memory before they can be executed. Similarly, all data must be brought into main memory before a program can manipulate it. When the computer is turned off, everything in main memory is lost for good. Copyright 2004 by Course Technology. All rights reserved.This publication is protected by federal copyright law. No part of this publication may be reproduced without prior permission in writing from Course Technology. Some of the product names and company names have been used for identification purposes only and may be trademarks or registered trademarks of their respective manufactures and sellers. Elements of a Computer System 5 Main memory is an ordered sequence of cells, called memory cells. Each cell has a unique location in main memory, called the address of the cell.These addresses help you access the information stored in the cell. Figure 1-2 shows main memory with 100 storage cells. 1 0 1 54 A 98 99 Hi 12.5 Figure 1-2 Main memory with 100 storage cells Today's computers come with main memory consisting of millions to billions of cells. Although Figure 1-2 shows data stored in cells, the content of a cell can be either a programming instruction or data. Secondary Storage Because programs and data must be stored in main memory before processing and because everything in main memory is lost when the computer is turned off, information stored in main memory must be transferred to some other device for permanent storage.The device that stores information permanently (unless the device becomes unusable or you change the information by rewriting it) is called secondary storage.To be able to transfer information from main memory to secondary storage, these components must be directly connected to each other. Examples of secondary storage are hard disks, floppy disks, ZIP disks, CD-ROMs, and tapes. Input/Output Devices For a computer to perform a useful task, it must be able to take in data and programs and display the results of calculations.The devices that feed data and programs into computers are called input devices. The keyboard, mouse, and secondary storage are examples of input devices.The devices that the computer uses to display results are called output devices. A monitor, printer, and secondary storage are examples of output devices. Copyright 2004 by Course Technology. All rights reserved.This publication is protected by federal copyright law. No part of this publication may be reproduced without prior permission in writing from Course Technology. Some of the product names and company names have been used for identification purposes only and may be trademarks or registered trademarks of their respective manufactures and sellers. 6 Chapter 1 An Overview of Computers and Programming Languages Software Software are programs written to perform specific tasks. For example, word processors are programs that you use to write letters, papers, and even books.There are two types of programs: system programs and application programs. System programs control the computer. The system program that loads first when you turn on your PC is called the operating system. Without an operating system, the computer is useless.The operating system monitors the overall activity of the computer and provides services. Some of these services include: memory management, input/output activities, and storage management. The operating system has a special program that organizes secondary storage so that you can conveniently access information. Moreover, operating systems are written in programming languages. Application programs perform a specific task. Word processors, spreadsheets, and games are examples of application programs. All application programs are written using computer programming languages.The operating system is the program that runs application programs. THE LANGUAGE OF A COMPUTER When you press A on your keyboard the computer displays A on the screen, but what is actually stored inside the computer's main memory? What is the language of the computer? How does it store whatever you type on the keyboard? Remember that a computer is an electronic device. Electrical signals are used inside the computer to process information. There are two types of electrical signals: analog and digital. Analog signals are continuous wave forms used to represent such things as sound. Audio tapes, for example, store data in analog signals. Digital signals represent information with a sequence of 0s and 1s. A 0 represents a low voltage, and a 1 represents a high voltage. Digital signals are more reliable carriers of information than are analog signals and can be copied from one device to another with exact precision.You might have noticed that when you make a copy of an audio tape, the sound quality of the copy is not as good as the original tape.This is because the analog signals may not be copied with exact precision.Therefore, of the two electrical signals, the computer uses digital signals. Because digital signals are processed inside a computer, the language of a computer, called machine language, is a sequence of 0s and 1s.The digit 0 or 1 is called a binary digit, or bit. Sometimes a sequence of 0s and 1s is referred to as binary code. Bit: A binary digit 0 or 1. A sequence of eight bits is called a byte. Every letter, number, or special symbol (such as * or {) on your keyboard is encoded as a sequence of bits, each having a unique representation. The most commonly used encoding scheme on personal computers is the seven-bit American Standard Code for Information Interchange (ASCII). The ASCII data set consists of 128 characters numbered 0 through 127.That is, in the ASCII data set, the number assigned Copyright 2004 by Course Technology. All rights reserved.This publication is protected by federal copyright law. No part of this publication may be reproduced without prior permission in writing from Course Technology. Some of the product names and company names have been used for identification purposes only and may be trademarks or registered trademarks of their respective manufactures and sellers. The Evolution of Programming Languages 7 to the first character is 0, the number assigned to the second character is 1, and so on. In this scheme, A is encoded as 1000001. In fact, A is the 66th character in the ASCII character code, but the number assigned to it is 65 because the number assigned to the first character is 0. Furthermore, 1000001 is the binary representation of 65.The character 3 is encoded as 0110011. For a complete list of the printable ASCII data set, refer to Appendix C. Inside the computer, every character is represented as a sequence of eight bits, that is, as a byte. Because ASCII is a seven-bit code, you must add 0 to the left of the ASCII encoding of a character. Hence, inside the computer, the character A is represented as 01000001, and the character 3 is represented as 00110011. There are other encoding schemes, such as EBCDIC (used by IBM) and Unicode, which is a more recent development. EBCDIC consists of 256 characters; Unicode consists of 65,536 characters.To store a character belonging to Unicode, you need two bytes. 1 THE EVOLUTION OF PROGRAMMING LANGUAGES The most basic language of a computer, the machine language, provides program instructions in bits. Even though most computers perform the same kinds of operations, the designers of the computer may have chosen different sets of binary codes to perform the operations. Therefore, the machine language of one machine is not necessarily the same as the machine language of another machine.The only consistency among computers is that in any modern computer, all data is stored and manipulated as binary codes. Early computers were programmed in machine language.To see how instructions are written in machine language, suppose you want to use the equation: wages=ratehours to calculate weekly wages. Further suppose that the binary code 100100 stands for load, 100110 stands for multiplication, and 100010 stands for store. In machine language, you might need the following sequence of instructions to calculate weekly wages: 100100010001 100110010010 100010010011 To represent the weekly wages equation in machine language, the programmer had to remember the machine language codes for various operations. Also, to manipulate data, the programmer had to remember the locations of the data in the main memory.This need to remember specific codes made programming not only very difficult, but also error-prone. Assembly languages were developed to make the programmer's job easier. In assembly language, an instruction is an easy-to-remember form called a mnemonic. For example, Table 1-1 shows some examples of instructions in assembly language and their corresponding machine language code. Copyright 2004 by Course Technology. All rights reserved.This publication is protected by federal copyright law. No part of this publication may be reproduced without prior permission in writing from Course Technology. Some of the product names and company names have been used for identification purposes only and may be trademarks or registered trademarks of their respective manufactures and sellers. 8 Chapter 1 An Overview of Computers and Programming Languages Table 1-1 Examples of Instructions in Assembly Language and Machine Language Assembly Language LOAD STOR MULT ADD SUB Machine Language 100100 100010 100110 100101 100011 Using assembly language instructions, you can write the equation to calculate the weekly wages as follows: LOAD MULT STOR rate hours wages As you can see, it is much easier to write instructions in assembly language. However, a computer cannot execute assembly language instructions directly.The instructions first have to be translated into machine language. A program called an assembler translates the assembly language instructions into machine language. Assembler: A program that translates a program written in assembly language into an equivalent program in machine language. Moving from machine language to assembly language made programming easier, but a programmer was still forced to think in terms of individual machine instructions.The next step toward making programming easier was to devise high-level languages that were closer to natural languages, such as English, French, German, and Spanish. Basic, FORTRAN, COBOL, Pascal, C, C++, and Java are all high-level languages.You will learn the high-level language C++ in this book. In C++, you write the weekly wages equation as follows: wages=rate*hours; The instruction written in C++ is much easier to understand and is self-explanatory to a novice user who is familiar with basic arithmetic. As in the case of assembly language, however, the computer cannot directly execute instructions written in a high-level language.To run on a computer, these C++ instructions first need to be translated into machine language. A program called a compiler translates instructions written in high-level languages into machine code. Compiler: A program that translates instructions written in a high-level language into the equivalent machine language. Copyright 2004 by Course Technology. All rights reserved.This publication is protected by federal copyright law. No part of this publication may be reproduced without prior permission in writing from Course Technology. Some of the product names and company names have been used for identification purposes only and may be trademarks or registered trademarks of their respective manufactures and sellers. Processing a High-Level Language Program 9 PROCESSING A HIGH-LEVEL LANGUAGE PROGRAM Now that you have some understanding of what a machine language and a high-level language are and recognize that the computer can understand only machine language, you are ready to review the steps required to execute programs written in a high-level language.You need to carry out the following five steps, as shown in Figure 1-3, to execute a program written in a high-level language. 1. You use a text editor to create a program in a high-level language following the rules, or syntax, of the high-level language.This program is called the source code or source program. Source program: A program written in a high-level language. 2. You must verify that the program obeys the rules of the programming language-- that is, the program is syntactically correct--and translate the program into the equivalent machine language.The compiler checks for correctness of syntax and translates a program into machine language.That is, the compiler checks the source program for syntax errors and, if no error is found, translates the program into the equivalent machine language.The equivalent machine language program is called an object program. Object program: The machine language version of the high-level language program. 3. The programs that you write in a high-level language are developed using a software development kit (SDK).The SDK contains many programs that are useful in creating your program. For example, it contains the necessary code (program) to display the results of the program and several mathematical functions to make the programmer's job somewhat easier.Therefore, if certain code is already available, you can use the available code rather than writing your own code. Once the program is developed and successfully compiled, you must still bring the code for the resources used from the SDK into your program to produce a final program that the computer can execute.This prewritten code (program) resides in a place called the library.A program called a linker combines the object program with the programs from libraries. Linker: A program that combines the object program with other programs in the library, and used in the program to create the executable code. 4. You must next load the executable program into main memory for execution.A program called a loader accomplishes this task. Loader: A program that loads an executable program into main memory. 5. The final step is to execute the program. 1 Copyright 2004 by Course Technology. All rights reserved.This publication is protected by federal copyright law. No part of this publication may be reproduced without prior permission in writing from Course Technology. Some of the product names and company names have been used for identification purposes only and may be trademarks or registered trademarks of their respective manufactures and sellers. 10 Chapter 1 An Overview of Computers and Programming Languages Step 1 Program Editor Step 2 Compiler Library Step 3 Linker Step 4 Loader Step 5 Execution Figure 1-3 Processing a high-level language program As a programmer, you need to be concerned with only Step 1. That is, you must learn, understand, and master the rules of the programming language to create source programs.As noted earlier, programs are developed using an SDK.Well-known SDKs used to create programs in the high-level language C++ include Visual C++ (from Microsoft), C++ Builder (from Borland), and CodeWarrior (from Metrowerks).These SDKs contain a text editor to create the source program, a compiler to check the source program for syntax errors, a program to link the object code with the resources used from the SDK, and a program to execute the program. Furthermore, these SDKs are quite user-friendly.When you compile your program, the compiler not only identifies the syntax errors, but also typically suggests how to correct them. Moreover, with just a simple command, the object code is linked with the resources used from the SDK.The command that does the linking on Visual C++ is Build or Rebuild; on C++ Builder, it is Build or Make; and on CodeWarrior, it is Make. (For further clarification regarding the use of these commands, check the documentation of these SDKs.) If the program is not yet compiled, each of these commands first compiles the program and then links and produces the executable code. N O T E In general, the development of a high-level language program goes through the five steps described above. A C++ program, however, goes through six steps--these five steps plus one more. This extra step takes place after Step 1, creating the source program, and before Step 2, compiling the source program. Of course, the SDK automatically takes care of this extra step. In Chapter 2, after being introduced to some basic elements of C++, you will see how a C++ program is processed. As a programmer, as noted above, you are still mainly concerned with the first step. That is, you must master the rules of C++ to create the source program. The Web site accompanying this book contains the necessary information, including screen shots, on how to use some of the SDKs such as Visual C++, Visual Studio .NET, and CodeWarrior. N O T E PROGRAMMING WITH THE PROBLEM ANALYSISCODINGEXECUTION CYCLE Programming is a process of problem solving. Different people use different techniques to solve problems. Some techniques are nicely outlined and easy to follow.They not only solve the problem, but also give insight into how the solution was reached.These problem-solving techniques can be easily modified if the domain of the problem changes. Copyright 2004 by Course Technology. All rights reserved.This publication is protected by federal copyright law. No part of this publication may be reproduced without prior permission in writing from Course Technology. Some of the product names and company names have been used for identification purposes only and may be trademarks or registered trademarks of their respective manufactures and sellers. Programming with the Problem Analysis-Coding-Execution Cycle 11 To be a good problem solver and hence to become a good programmer, you must follow good problem-solving techniques. One common problem-solving technique includes analyzing a problem, outlining the problem requirements, and designing steps, called an algorithm, to solve the problem. Algorithm: A step-by-step problem-solving process in which a solution is arrived at in a finite amount of time. In a programming environment, the problem-solving process requires the following three steps: 1. Analyze the problem, outline the problem and its solution requirements, and design an algorithm to solve the problem. 2. Implement the algorithm in a programming language, such as C++, and verify that the algorithm works. 3. Maintain the program by using and modifying it if the problem domain changes. Figure 1-4 summarizes this three-step programming process. 1 Problem Analysis Algorithm Design Coding Error Compiler Syntax Library No Error Linker Loader Execution Error Results Figure 1-4 Problem analysiscodingexecution cycle Copyright 2004 by Course Technology. All rights reserved.This publication is protected by federal copyright law. No part of this publication may be reproduced without prior permission in writing from Course Technology. Some of the product names and company names have been used for identification purposes only and may be trademarks or registered trademarks of their respective manufactures and sellers. 12 Chapter 1 An Overview of Computers and Programming Languages To develop a program to solve a problem, you start by analyzing the problem. You then design the algorithm; write the program instructions in a high-level language, or code the program; and enter the program into a computer system. Analyzing the problem is the first and most important step.This step requires you to do the following: 1. Thoroughly understand the problem. 2. Understand the problem requirements. Requirements can include whether the program requires interaction with the user, whether it manipulates data, whether it produces output, and what the output looks like. If the program manipulates data, the programmer must know what the data is and how it is represented.That is, you need to look at sample data. If the program produces output, you should know how the results should be generated and formatted. 3. If the problem is complex, divide the problem into subproblems and repeat Steps 1 and 2.That is, for complex problems, you need to analyze each subproblem and understand each subproblem's requirements. After you carefully analyze the problem, the next step is to design an algorithm to solve the problem. If you broke the problem into subproblems, you need to design an algorithm for each subproblem. Once you design an algorithm, you need to check it for correctness.You can sometimes test an algorithm's correctness by using sample data.At other times, you might need to perform some mathematical analysis to test the algorithm's correctness. Once you have designed the algorithm and verified its correctness, the next step is to convert the equivalent code into the high-level language.You use a text editor to enter the program into a computer.You must then make sure that the program follows the language's syntax.To verify the correctness of the syntax, you run the code through a compiler. If the compiler generates error messages, you must identify the errors in the code, remove them, and then run the code through the compiler again.When all the syntax errors are removed, the compiler generates the equivalent machine code, the linker links the machine code with the system's resources, and the loader places the program into main memory so that it can be executed. The final step is to execute the program. The compiler guarantees only that the program follows the language's syntax. It does not guarantee that the program will run correctly. During execution the program might terminate abnormally due to logical errors, such as division by zero. Even if the program terminates normally, it may still generate erroneous results. Under these circumstances, you may have to reexamine the code, the algorithm, or even the problem analysis. Your overall programming experience will benefit if you spend enough time to thoroughly analyze the problem and design the algorithm before attempting to write programming instructions. Usually, you do this work on paper using a pen or pencil. Taking this careful approach to programming has a number of advantages. It is much easier to discover errors in a program that is well analyzed and well designed. Furthermore, a thoroughly analyzed and carefully designed program is much easier to follow and modify. Even the most experienced programmers spend a considerable amount of time analyzing a problem and designing an algorithm. Copyright 2004 by Course Technology. All rights reserved.This publication is protected by federal copyright law. No part of this publication may be reproduced without prior permission in writing from Course Technology. Some of the product names and company names have been used for identification purposes only and may be trademarks or registered trademarks of their respective manufactures and sellers. Programming with the Problem Analysis-Coding-Execution Cycle 13 Throughout this book, you will not only learn the rules of writing programs in C++, but also learn problem-solving techniques. Each chapter discusses several programming problems, each of which is clearly marked as a Programming Example.These Programming Examples teach techniques of how to analyze and solve problems and also help you understand the concepts discussed in the chapter.To gain the full benefit of this book, we recommend that you work through the Programming Examples at the end of each chapter. Example 1-1 1 In this example, we design an algorithm to find the perimeter and area of a rectangle. To find the perimeter and area of a rectangle, you need to know the rectangle's length and width.The perimeter and area of the rectangle are then given by the following formulas: perimeter=2(length+width) area=lengthwidth The algorithm to find the perimeter and area of the rectangle is, therefore: 1. Get the length of the rectangle. 2. Get the width of the rectangle. 3. Find the perimeter using the following equation: perimeter=2(length+width) 4. Find the area using the following equation: area=lengthwidth Example 1-2 In this example, we design an algorithm that calculates the sales tax and the price of an item sold in a particular state. The sales tax is calculated as follows:The state's portion of the sales tax is 4% and the city's portion of the sales tax is 1.5%. If the item is a luxury item, such as a car over $50000, then there is a 10% luxury tax. To calculate the price of the item, we need to calculate the state's portion of the sales tax, the city's portion of the sales tax and, if it is a luxury item, the luxury tax. Suppose salePrice denotes the selling price of the item, stateSalesTax denotes the state's sales tax, citySalesTax denotes the city's sales tax, luxuryTax denotes the luxury tax, salesTax denotes the total sales tax, and amountDue the final price of the item. To calculate the sales tax, we must know the selling price of the item and whether the item is a luxury item. The stateSalesTax and citySalesTax can be calculated using the following formulas: stateSalesTax=salePrice0.04 citySalesTax=salePrice0.015 Copyright 2004 by Course Technology. All rights reserved.This publication is protected by federal copyright law. No part of this publication may be reproduced without prior permission in writing from Course Technology. Some of the product names and company names have been used for identification purposes only and may be trademarks or registered trademarks of their respective manufactures and sellers. 14 Chapter 1 An Overview of Computers and Programming Languages Next, you can determine luxuryTax as follows: if(itemisaluxuryitem) luxuryTax=salePrice0.1 otherwise luxuryTax=0 Next, you can determine salesTax as follows: salesTax=stateSalesTax+citySalesTax +luxuryTax Finally, you can calculate amountDue as follows: amountDue=salePrice+salesTax The algorithm to determine salesTax and amountDue is, therefore: 1. Get the selling price of the item. 2. Determine whether the item is a luxury item. 3. Find the state's portion of the sales tax using the formula: stateSalesTax=salePrice0.04 4. Find the city's portion of the sales tax using the formula: citySalesTax=salePrice0.015 5. Find the luxury tax using the following formulas: if(itemisaluxuryitem) luxuryTax=salePrice0.1 otherwise luxuryTax=0 6. Find salesTax using the formula: salesTax=stateSalesTax+citySalesTax +luxuryTax 7. Find amountDue using the formula: amountDue=salePrice+salesTax Example 1-3 In this example, we design an algorithm that calculates the monthly paycheck of a salesperson at a local department store. Every salesperson has a base salary.The salesperson also receives a bonus at the end of each month based on the following criteria: If the salesperson has been with the store for five years Copyright 2004 by Course Technology. All rights reserved.This publication is protected by federal copyright law. No part of this publication may be reproduced without prior permission in writing from Course Technology. Some of the product names and company names have been used for identification purposes only and may be trademarks or registered trademarks of their respective manufactures and sellers. Programming with the Problem Analysis-Coding-Execution Cycle 15 or less, the bonus is $10 for each year that he or she has worked there. If the salesperson has been with the store for more than five years, the bonus is $20 for each year that he or she has worked there.The salesperson can earn an additional bonus as follows: If the total sale made by the salesperson for the month is more than $5000 but less than $10000, he or she receives a 3% commission on the sale. If the total sale made by the salesperson for the month is at least $10000, he or she receives a 6% commission on the sale. To calculate a salesperson's monthly paycheck, you need to know the base salary, the number of years that the salesperson has been with the company, and the total sale made by the salesperson for that month. Suppose baseSalary denotes the base salary, noOfServiceYears denotes the number of years that the salesperson has been with the store, bonus denotes the bonus, totalSale denotes the total sale made by the salesperson for the month, and additionalBonus denotes the additional bonus. You can determine the bonus as follows: if(noOfServiceYearsislessthanorequaltofive) bonus=10noOfServiceYears otherwise bonus=20noOfServiceYears 1 Next, you can determine the additional bonus of the salesperson as follows: if(totalSaleislessthan5000) additionalBonus=0 otherwise if(totalSaleisgreaterthanorequalto5000and totalSaleislessthan10000) additionalBonus=totalSale(0.03) otherwise additionalBonus=totalSale(0.06) Following the above discussion, you can now design the algorithm to calculate a salesperson's monthly paycheck. 1. Get baseSalary. 2. Get noOfServiceYears. 3. Calculate bonus using the following formula: if(noOfServiceYearsislessthanorequaltofive) bonus=10noOfServiceYears otherwise bonus=20noOfServiceYears 4. Get totalSale. Copyright 2004 by Course Technology. All rights reserved.This publication is protected by federal copyright law. No part of this publication may be reproduced without prior permission in writing from Course Technology. Some of the product names and company names have been used for identification purposes only and may be trademarks or registered trademarks of their respective manufactures and sellers. 16 Chapter 1 An Overview of Computers and Programming Languages 5. Calculate additionalBonus using the following formula: if(totalSaleislessthan5000) additionalBonus=0 otherwise if(totalSaleisgreaterthanorequalto5000and totalSaleislessthan10000) additionalBonus=totalSale(0.03) otherwise additionalBonus=totalSale(0.06) 6. Calculate payCheck using the equation: payCheck=baseSalary+bonus+additionalBonus PROGRAMMING METHODOLOGIES Two popular approaches to programming design are the structured approach and the objectoriented approach, which are outlined below. Structured Programming Dividing a problem into smaller subproblems is called structured design. In structured design, the problem is divided into smaller subproblems. Each subproblem is then analyzed, and a solution is obtained to solve the subproblem.The solutions to all the subproblems are then combined to solve the overall problem. This process of implementing a structured design is called structured programming.The structured design approach is also known as top-down design, stepwise refinement, and modular programming. Object-Oriented Programming The previous section discussed the structured design programming methodology.This section briefly describes a programming methodology called object-oriented design (OOD), which is widely used. In OOD, the first step in the problem-solving process is to identify the components called objects, which form the basis of the solution, and determine how these objects interact with one another. For example, suppose you want to write a program that automates the video rental process for a local video store.The two main objects in this problem are the video and the customer. After identifying the objects, the next step is to specify for each object the relevant data and possible operations to be performed on that data. For example, for a video object, the data Copyright 2004 by Course Technology. All rights reserved.This publication is protected by federal copyright law. No part of this publication may be reproduced without prior permission in writing from Course Technology. Some of the product names and company names have been used for identification purposes only and may be trademarks or registered trademarks of their respective manufactures and sellers. Programming Methodologies 17 might include the movie name, starring actors, producer, production company, number of copies in stock, and so on. Some of the operations on a video object might include checking the name of the movie, reducing the number of copies in stock by one after a copy is rented, and incrementing the number of copies in stock by one after a customer returns a particular video. This illustrates that each object consists of data and operations on that data. An object combines data and operations on the data into a single unit. In OOD, the final program is a collection of interacting objects. A programming language that implements OOD is called an object-oriented programming (OOP) language. You will learn about the many advantages of OOD in later chapters. Because an object consists of data and operations on that data, before you can design and use objects, you need to learn how to represent data in computer memory, how to manipulate data, and how to implement operations. In Chapter 2, you will learn the basic data types of C++ and discover how to represent and manipulate data in computer memory. Chapter 3 discusses how to input data into a C++ program and output the results generated by a C++ program. To create operations, you write algorithms and implement them in a programming language. Because a data element in a complex program usually has many operations, to separate operations from each other and to use them effectively and in a convenient manner, you use functions to implement algorithms. After a brief introduction in Chapters 2 and 3, you will learn the details of functions in Chapters 6 and 7. Certain algorithms require that a program make decisions, a process called selection. Other algorithms might require certain statements to be repeated until certain conditions are met, a process called repetition. Still other algorithms might require both selection and repetition.You will learn about selection and repetition mechanisms, called control structures, in Chapters 4 and 5. Also, in Chapter 9, using a mechanism called an array, you will learn how to manipulate data when data items are of the same type, such as items in a list of sales figures. Finally, to work with objects, you need to know how to combine data and operations on the data into a single unit. In C++, the mechanism that allows you to combine data and operations on the data into a single unit is called a class.You will learn how classes work, how to work with classes, and how to create classes in Chapter 11. As you can see, you need to learn quite a few things before working with the OOD methodology. To make this learning easier and more effective, this book purposely divides control structures into two chapters (4 and 5) and user-defined functions into two chapters (6 and 7). For some problems, the structured approach to program design will be very effective. Other problems will be better addressed by OOD. For example, if a problem requires manipulating sets of numbers with mathematical functions, you might use the structured design approach and outline the steps required to obtain the solution.The C++ library supplies a wealth of functions that you can use effectively to manipulate numbers. On the other hand, if you want to write a program that would make a candy machine operational, the OOD approach is more effective. C++ was designed especially to implement OOD. Furthermore, OOD works well and is used in conjunction with structured design. Copyright 2004 by Course Technology. All rights reserved.This publication is protected by federal copyright law. No part of this publication may be reproduced without prior permission in writing from Course Technology. Some of the product names and company names have been used for identification purposes only and may be trademarks or registered trademarks of their respective manufactures and sellers. 1 18 Chapter 1 An Overview of Computers and Programming Languages Both the structured design and OOD approaches require that you master the basic components of a programming language to be an effective programmer. In the next few chapters, you will learn the basic components of C++ required by either type of programming.After presenting the basic concepts, Chapters 2 through 10 will use the structured programming approach to solve and program particular problem solutions. From Chapter 11 onward, the book focuses on problem solving and programming with OOD. ANSI/ISO STANDARD C++ The programming language C++ evolved from C and was designed by Bjarne Stroustrup at Bell Laboratories in the early 1980s. From the early 1980s through the early 1990s, several C++ compilers were available. Even though the fundamental features of C++ in all compilers were mostly the same, the C++ language, referred to in this book as Standard C++, was evolving in slightly different ways in different compilers. As a consequence, C++ programs were not always portable from one compiler to another. To address this problem, in the early 1990s, a joint committee of the American National Standard Institution (ANSI) and International Standard Organization (ISO) was established to standardize the syntax of C++. In mid-1998, ANSI/ISO C++ language standards were approved. Most of today's compilers comply with this new standard. This book focuses on the syntax of C++ as approved by ANSI/ISO, referred to as ANSI/ISO Standard C++. QUICK REVIEW 1. A computer is an electronic device capable of performing arithmetic and logical 2. 3. 4. 5. 6. 7. 8. operations. A computer system has two components: hardware and software. The central processing unit (CPU) and the main memory are examples of hardware components. The control unit (CU) controls a program's overall execution. It is one of several components of the CPU. The arithmetic logic unit (ALU) is the component of the CPU that performs arithmetic and logical operations. The instructor register (IR) holds the instruction currently being executed. The program counter (PC) points to the next instruction to be executed. All programs must be brought into main memory before they can be executed. Copyright 2004 by Course Technology. All rights reserved.This publication is protected by federal copyright law. No part of this publication may be reproduced without prior permission in writing from Course Technology. Some of the product names and company names have been used for identification purposes only and may be trademarks or registered trademarks of their respective manufactures and sellers. Quick Review 19 9. When the power is switched off, everything in main memory is lost. 10. Secondary storage provides permanent storage for information. Hard disks, floppy disks, 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27. 28. 29. 30. ZIP disks, CD-ROMs, and tapes are examples of secondary storage. Input to the computer is done via an input device.Two common input devices are the keyboard and the mouse. The computer sends its output to an output device such as the computer screen. Software are programs run by the computer. The operating system monitors the overall activity of the computer and provides services. The most basic language of a computer is a sequence of 0s and 1s called machine language. Every computer directly understands its own machine language. A bit is a binary digit, 0 or 1. A byte is a sequence of eight bits. Assembly language uses easy-to-remember instructions called mnemonics. Assemblers are programs that translate a program written in assembly language into machine language. Compilers are programs that translate a program written in a high-level language into machine code, called object code. A linker links the object code with other programs provided by the software development kit (SDK) and used in the program to produce executable code. In a high-level language, five steps are needed to execute a program: edit, compile, link, load, and execute. A loader transfers executable code into main memory. An algorithm is a step-by-step problem-solving process in which a solution is arrived at in a finite amount of time. The problem-solving process has three steps: analyze the problem and design an algorithm, implement the algorithm in a programming language, and maintain the program. Programs written using the structured design approach are easier to understand, easier to test and debug, and easier to modify. In structured design, a problem is divided into smaller subproblems. Each subproblem is solved, and the solutions to all the subproblems are then combined to solve the problem. In object-oriented design (OOD), a program is a collection of interacting objects. An object consists of data and operations on those data. The ANSI/ISO Standard C++ syntax was approved in mid-1998. 1 Copyright 2004 by Course Technology. All rights reserved.This publication is protected by federal copyright law. No part of this publication may be reproduced without prior permission in writing from Course Technology. Some of the product names and company names have been used for identification purposes only and may be trademarks or registered trademarks of their respective manufactures and sellers. 20 Chapter 1 An Overview of Computers and Programming Languages EXERCISES 1. Mark the following statements as true or false. 2. 3. 4. 5. 6. 7. 8. 9. 10. a. Assembly language is the language that uses mnemonics for its instructions. b. A compiler translates an assembly language program into machine code. c. The arithmetic logic unit performs arithmetic operations and, if an error is found, it outputs the logical errors. d. A loader loads the object code from main memory into the CPU for execution. e. Development of a high-level language program includes six steps. f. The CPU functions under the control of the control unit. g. RAM stands for readily available memory. h. A program written in a high-level programming language is called a source program. i. The operating system is the first program loaded into the computer when the power is turned on. j. The first step in the problem-solving process is to analyze the problem. Name some components of the central processing unit. What is the function of the control unit? Name two input devices. Name two output devices. Why is secondary storage needed? Why do you need to translate a program written in a high-level language into machine language? Why would you prefer to write a program in a high-level language rather than a machine language? What are the advantages of problem analysis and algorithm design over directly writing a program in a high-level language? Design an algorithm to find the weighted average of four test scores.The four test scores and their respective weights are given in the following format: testscore1weight1 ... For example, a sample data is as follows: 750.20 950.35 850.15 650.30 Copyright 2004 by Course Technology. All rights reserved.This publication is protected by federal copyright law. No part of this publication may be reproduced without prior permission in writing from Course Technology. Some of the product names and company names have been used for identification purposes only and may be trademarks or registered trademarks of their respective manufactures and sellers. Exercises 21 11. A salesperson leaves his home every Monday and returns every Friday. He travels by company car. Each day on the road, the salesperson records the amount of gasoline put in the car. Given the starting odometer reading (that is, the odometer reading before he leaves on Monday) and the ending odometer reading (the odometer reading after he returns home on Friday), design an algorithm to find the average miles per gallon. Sample data is as follows: 687237128915.7516.3010.9520.6530.00 1 12. To make a profit, the prices of the items sold in a furniture store are marked up by 60%. Design an algorithm to find the selling price of an item sold at the furniture store.What information do you need to find the selling price? 13. Suppose a, b, and c denote the lengths of the sides of a triangle.Then the area of the triangle can be calculated using the formula: s( s - a )( s - b )( s - c ), where s = (1/2)(a + b + c). Design an algorithm that uses this formula to find the area of a triangle.What information do you need to find the area? Copyright 2004 by Course Technology. All rights reserved.This publication is protected by federal copyright law. No part of this publication may be reproduced without prior permission in writing from Course Technology. Some of the product names and company names have been used for identification purposes only and may be trademarks or registered trademarks of their respective manufactures and sellers. Copyright 2004 by Course Technology. All rights reserved.This publication is protected by federal copyright law. No part of this publication may be reproduced without prior permission in writing from Course Technology. Some of the product names and company names have been used for identification purposes only and may be trademarks or registered trademarks of their respective manufactures and sellers.

Find millions of documents on Course Hero - Study Guides, Lecture Notes, Reference Materials, Practice Exams and more. Course Hero has millions of course specific materials providing students with the best way to expand their education.

Below is a small sample set of documents:

CSU Fullerton - CS - 901
2Basic Elements of C+In this chapter, you will:the basic components of C+ Become familiar withfunctions, special symbols,aand program, including identifiers Explore simple data types and examine the string data type Discover how to use arithmet
CSU Fullerton - CS - 901
3Input/OutputIn this chapter, you will: Learn what a stream is and examine input and output streams input device Explore how to read data from the standardprogram use predefined functions in a Learn how toto use the input stream functions get
CSU Fullerton - ECS - 463
Chapter 3Graphics Output PrimitivesSome slides adapted fromBenjamin Lok, Ilmi Yoon and Falko KuesterExpanded by Jozef GoetzGlossary CG API Computer Graphics Application Programming Interface tbs to be specified FoV Field of View +'s p
CSU Fullerton - ECS - 463
#include <GL/glut.h> class scrPt { public: GLint x, y; }; void setPixel (GLint x, GLint y) { glBegin (GL_POINTS); glVertex2i (x, y); glEnd ( ); } void circleMidpoint (scrPt circCtr, GLint ra
CSU Fullerton - ECS - 463
const double TWO_PI = 6.2831853; GLuint regHex; GLdouble theta; GLint x, y, k; /* Set up a display list for a regular hexagon. * Vertices for the hexagon are six equally spaced * points around the circumference of
CSU Fullerton - ECS - 463
void boundaryFill4 (int x, int y, int fillColor, int borderColor) { int interiorColor; /* Set current color to fillColor, then perform following oprations. */ getPixel (x, y, interiorColor); if (interiorColor != borde
CSU Fullerton - ECS - 463
void floodFill4 (int x, int y, int fillColor, int interiorColor) { int color; /* Set current color to fillColor, then perform following operations. */ getPixel (x, y, color); if (color = interiorColor) { setPix
CSU Fullerton - ECS - 463
class wcPt2D { public: GLfloat x, y; }; void scalePolygon (wcPt2D * verts, GLint nVerts, wcPt2D fixedPt, GLfloat sx, GLfloat sy) { wcPt2D vertsNew; GLint k; for (k = 0; k
CSU Fullerton - ECS - 463
class wcPt2D { private: GLfloat x, y; public: /* Default Constructor: initialize position as (0.0, 0.0). */ wcPt3D ( ) { x = y = 0.0; } setCoords (GLfloat xCoord, GLfloat yCoord) {
CSU Fullerton - ECS - 463
class wcPt2D { private: GLfloat x, y; public: /* Default Constructor: initialize position as (0.0, 0.0). */ wcPt3D ( ) { x = y = 0.0; } setCoords (GLfloat xCoord, GLfloat yCoord) {
CSU Fullerton - ECS - 463
GLUnurbsObj *bezSurface; GLfloat outerTrimPts [5][2] = { {0.0, 0.0}, {1.0, 0.0}, {1.0, 1.0), {0.0, 1.0}, {0.0, 0.0} }; GLfloat innerTrimPts1 [3][2] = { {0.25, 0.5}, {0.5, 0.75},
CSU Fullerton - ECS - 463
GLint k; GLubyte texLine [16]; / 16-element texture array. /* Define two green elements for the texture pattern. /* Each texture color is specified in four array positions. */ for (k = 0; k <= 2; k += 2) {
CSU Fullerton - ECS - 463
#include <GL/glut.h> #include <stdio.h> const GLint pickBuffSize = 32; /* Set initial display-window size. */ GLsizei winWidth = 400, winHeight = 400; void init (void) { /* Set display-window color to white. */
CSU Fullerton - CS - 901
Programming Concepts & Fundamental Data Structures (CPSC-901) Fall 2004Chapter 4 Programming Exercise 9 For LoopsJeff Giacomi jeffg@giacomi.com Last four digits of Student ID: 8396 Section 01 MW 4:00Submitted to Dr. Jozef Goetz California State
CSU Fullerton - CS - 901
0123456789ABCDEFCHIJKLMNOPQRSTUVWXYZ
CSU Fullerton - CS - 901
Code Digit Code Digit Copy 9 9 2 2 7 7 8 8 3 3 5 5 6 6Message transmitted OK.
CSU Fullerton - CS - 901
Goofy 65 78 65 89 25 98 -999Pluto 87 34 89 99 26 78 64 34 -999Balto 23 99 98 97 26 78 100 63 87 23 -999Piggy 62 35 78 99 12 93 19 -999
CSU Fullerton - CS - 901
Student# Test1 Test2 Test3 Test4 Test5 Average GradeBalto 85 83 77 91 76 82.40 BMickey 80 90 95 93 48 81.20 BMinnie 78 81 11 90 73 66.60 DDoc 92
CSU Fullerton - CS - 901
ABC 123.45 130.95 132.00 125.00 120.50 10000MSET 120.00 140.00 145.00 140.00 115.00 30920AOLK 80 75 82 74 83 5000CSCO 100 102 105 98 101 25000IBD 68 71 72 67 75 15000
Wright State - CHM - 123
CHM 123 Test 11. c 6. b 11. d2. c 7. d 12. a3. c 8. b 13. a4. a 9. a 14. d5. b 10. c 15. a or dA. The following set of data was obtained by the method of initial rates for the reaction: H2PO4-(aq) + OH-(aq) HPO42- (aq) + H2O(l) a) What i
Wright State - CHM - 123
CHEMICAL KINETICSDavid A. Grossie, 2002CHEMICAL KINETICSKinetics is the study of how fast chemical reactions occur. There are 4 important factors which affect rates of reactions:reactant concentration, temperature, action of catalysts, and surf
Wright State - CHM - 123
ThermodynamicsENTROPY, FREE ENERGY, AND EQUILIBRIUMLaws of Thermodynamics Inany process, spontaneous or nonspontaneous, the total energy of a system and its surroundings is constant. In any spontaneous process, the total entropy of a system an
Wright State - CHM - 123
Electrolytic CellsElectroChemistryHow Batteries Work.an electric current drives a nonspontaneous reaction.Galvanic Cellsa spontaneous chemical reaction generates an electric current.Redox Reaction.Pb(NO3)2(aq) + Ni (s) Pb (s) + Ni(NO3)2 (
Wright State - CHM - 122
Sample Test 3 Answers1. b 6. a 11. a 16. b 2. c 7. d 12. e 17. c 3. b 8. b 13. d 18. b 4. e 9. a 14. c 19. e 5. e 10. a 15. a 20. a21.A one liter solution of 2.5 g of polystyrene in benzene has an osmotic pressure of 4.5 x 10-2 atm at 50C. Calcu
Wright State - CHM - 101
Questions Acids and Bases Chemical OppositesWhat are the chemical properties of acids and bases? What does it mean to say that an acid or base is weak or strong? What happens when acids react with bases? What does pH mean and how is it used? What is
Wright State - CHM - 457
Physical Chemistry Sime, page 548
Wright State - CHM - 457
Wright State - CHM - 121
Covalent BondsA bond formed by the sharing of electrons between atoms.Covalent BondingLewis FormulasAtomsF [He]2s22p5Octet RuleMolecules are most stable when there are eight electrons in the outer shell of each atomFMoleculesF2F+
Wright State - CHM - 121
Valence Shell Electron-Pair Repulsion (VSEPR) theory 1. Applicable to molecules in which a central atom is bonded to two or more atoms 2. The electron-pairs of the valence shell of the central atom are assumed to take positions as far apart as possib
Rochester - CS - 244
%!PS-Adobe-2.0 %Creator: dvips(k) 5.86 Copyright 1999 Radical Eye Software %Title: lispLab.dvi %Pages: 2 %PageOrder: Ascend %BoundingBox: 0 0 612 792 %EndComments %DVIPSWebPage: (www.radicaleye.com) %DVIPSCommandLine: dvips -o lispLab.ps lispLab %DVI
St. Francis IL - CSCI - 467
I nt r uder sTopicsI nt r uder s I nt r usion det ect ion Passwor d managementI nt r uder sAlso known as hacker s or cr acker s One of t he most publicized t hr eat s t o secur it y Thr ee classes: M asquer ader : Someone not aut hor ized t o u
Rochester - CS - 252
Rochester - CSC - 173
CSC 173 Homework 1 12th September, 2006 Due in class on Thursday, September 14th, 2006Title (T) Solaris Enders Game Enders Shadow Once and Future King The Da Vinci Code Best Karate Leonardo da Vinci Leonardo da Vinci Name of the RoseAuthor (A) Le
Rochester - CSC - 173
%!PS-Adobe-2.0 %Creator: dvips(k) 5.95a Copyright 2005 Radical Eye Software %Title: homework-1.dvi %Pages: 2 %PageOrder: Ascend %BoundingBox: 0 0 612 792 %DocumentFonts: CMR10 CMBX10 CMR8 CMTI10 CMTT10 CMSY10 CMR6 CMR9 %DocumentPaperSizes: Letter %En
Rochester - CSC - 173
CSC 173 Homework 2 25th September, 2006 Due in class on Thursday, September 28th, 20061. In class, we used an example database from the book with the relations CSG, SNAP, CDH, and CR. The book also denes a 5th relation, namely CP, for course/prereq
Rochester - CSC - 173
%!PS-Adobe-2.0 %Creator: dvips(k) 5.95a Copyright 2005 Radical Eye Software %Title: homework-2.dvi %Pages: 2 %PageOrder: Ascend %BoundingBox: 0 0 612 792 %DocumentFonts: CMR10 CMBX10 CMTT10 %DocumentPaperSizes: Letter %EndComments %DVIPSWebPage: (www
Rochester - CSC - 173
CSC 173 Homework 3 12th October, 2006 Due in class on Thursday, October 19th, 2006 1. Describe in English the language of the following NDFA.b a a a2. Write the regular expression for the previous NDFA. 3. Using subset construction, convert the ND
Rochester - CSC - 173
%!PS-Adobe-2.0 %Creator: dvips(k) 5.92b Copyright 2002 Radical Eye Software %Title: homework-3.dvi %Pages: 1 %PageOrder: Ascend %BoundingBox: 0 0 612 792 %DocumentFonts: CMR10 CMBX10 CMMI10 CMSY8 CMSY10 CMTI10 %EndComments %DVIPSWebPage: (www.radical
Rochester - CS - 290
Paul.Here's my list of places where I personally got hung up in MAKING,BREAKING. Some are (I believe) just typos, some are maybe just me,and in some cases I'd love to see more text. Also I should apologisethat I didn't make a concerted effort
Rochester - CSC - 173
%!PS-Adobe-3.0 %Title: Microsoft PowerPoint - 173_relations.ppt %Creator: PScript5.dll Version 5.2 %CreationDate: 10/22/2004 12:31:26 %BoundingBox: (atend) %Pages: (atend) %Orientation: Portrait %PageOrder: Special %DocumentNeededResources: (atend) %
Rochester - CSC - 173
Lecture notes for CSC 173, Tues. Sept. 15 - , 2005 - READING ASSIGNMENT: see web pointers and books on reserve. HOMEWORK ASSIGNMENT is on the web -=CFirst: Why study C?C is the language of choice for systems programming, includi
Rochester - CSC - 173
#%-12345X@PJL JOB @PJL SET RESOLUTION = 600 @PJL ENTER LANGUAGE = POSTSCRIPT %!PS-Adobe-3.0 %Title: Microsoft PowerPoint - 173_graphs.ppt %Creator: PScript5.dll Version 5.2.2 %CreationDate: 11/16/2004 16:32:32 %BoundingBox: (atend) %Pages: (atend) %O
Rochester - CSC - 173
%!PS-Adobe-3.0 %Title: Microsoft PowerPoint - prop_logic.ppt %Creator: PScript5.dll Version 5.2.2 %CreationDate: 12/6/2004 14:10:1 %BoundingBox: (atend) %Pages: (atend) %Orientation: Portrait %PageOrder: Special %DocumentNeededResources: (atend) %Doc
Rochester - CSC - 173
%!PS-Adobe-3.0 %Title: Microsoft PowerPoint - queuing.ppt %Creator: PScript5.dll Version 5.2.2 %CreationDate: 12/7/2006 9:16:11 %BoundingBox: (atend) %Pages: (atend) %Orientation: Portrait %PageOrder: Special %DocumentNeededResources: (atend) %Docume
Rochester - CS - 290
Rochester - CS - 290
Rochester - CSC - 254
%!PS-Adobe-2.0 %Creator: dvips(k) 5.86 Copyright 1999 Radical Eye Software %Title: evaluation.dvi %Pages: 1 %PageOrder: Ascend %BoundingBox: 0 0 612 792 %EndComments %DVIPSWebPage: (www.radicaleye.com) %DVIPSCommandLine: dvips evaluation.dvi -o %DVIP
Rochester - CSC - 254
#%-12345X@PJL JOB @PJL SET RESOLUTION = 600 @PJL ENTER LANGUAGE = POSTSCRIPT %!PS-Adobe-3.0 %Title: Microsoft PowerPoint - csc254_lecture1 %Creator: PScript5.dll Version 5.2 %CreationDate: 9/11/2003 12:51:5 %BoundingBox: (atend) %Pages: (atend) %Orie
Rochester - CSC - 254
#%-12345X@PJL JOB @PJL SET RESOLUTION = 600 @PJL ENTER LANGUAGE = POSTSCRIPT %!PS-Adobe-3.0 %Title: Microsoft PowerPoint - csc254_lecture2 %Creator: PScript5.dll Version 5.2 %CreationDate: 10/30/2003 18:39:6 %BoundingBox: (atend) %Pages: (atend) %Ori
Rochester - CSC - 254
#%-12345X@PJL JOB @PJL SET RESOLUTION = 600 @PJL ENTER LANGUAGE = POSTSCRIPT %!PS-Adobe-3.0 %Title: Microsoft PowerPoint - csc254_lecture3 %Creator: PScript5.dll Version 5.2 %CreationDate: 10/14/2003 11:3:45 %BoundingBox: (atend) %Pages: (atend) %Ori
Rochester - CSC - 254
%!PS-Adobe-3.0 %Title: Microsoft PowerPoint - cs254_lecture5 %Creator: PScript5.dll Version 5.2 %CreationDate: 10/17/2003 19:19:12 %BoundingBox: (atend) %Pages: (atend) %Orientation: Portrait %PageOrder: Special %DocumentNeededResources: (atend) %Doc
Rochester - CSC - 254
#%-12345X@PJL JOB @PJL SET RESOLUTION = 600 @PJL ENTER LANGUAGE = POSTSCRIPT %!PS-Adobe-3.0 %Title: Microsoft PowerPoint - csc254_lecture7 %Creator: PScript5.dll Version 5.2 %CreationDate: 10/30/2003 18:36:25 %BoundingBox: (atend) %Pages: (atend) %Or
Rochester - CSC - 254
V 5 B 5 P & 6 F 56 5 P F 5 D B % & & ) % D P 5 P %F 5F % & % ) % 5 B 0 B cCSeYy%G!5QC(o!%CdXIGSAQf(oQ(C(cQAyQ'SSpGGy5Sb` ls Y e s e u Xu u X e e e z v j v e V 5 % 5 P 5 4 6 F5 GIfS(IAw(vG!5(Gs6 5 P 6 F 5 D B %
Rochester - CSC - 254
TA4XIEH@HiX1s5IYWe1EIDAa5W0V)E4aQIe19X5$!4Ihd"E6XeXIWIyaa@ Y 5 D 4 D 4 @ 5 1 0 r 4 4 r 3 3 5 3 r 5 1 H Y D e P 5 4 1 @ 5 5 1Y 0 4 H t r T I9H9Hs9)'dQA )9XA0QQ3y9) 'ddHXA!0EEe!@XCAIXuEEWA!YY H 4 3 r 1 4 p54 44D H r4400 5
Rochester - CSC - 254
v i@ a @ I0& E X8 0 B I0 & I0 cc&(8 @ Gtq%96R9937d4t94)1)e90 H94fe9h046)h& u R694h&X u r WbW94nDhnD7@Y%1%R)r u R694e59h0re9R9gaDy &3 0 ( & I(3 8 X & B X X # E &cc 8 0c 8 & E cc 8 & X @ X & a @ ( @ a &c X # E &cc 8 ` X c &3 & I0 X @ 0Rxw U
Rochester - CSC - 254
q 5 j @ @ 2 j 2 V j UVV @ ( U 72 @5 @ X52 EV 5 E (55 d5 A 5 (525 X 2 5 E S 4VW63X@T3(U43Tj3(FVF)U 5F495#X 49irFU 3FY66e1i60 646ba`3'53"60 (F3'3FhVgDU E TR q u 5 ( U V ( U ed U 2 5 X ( 0 460 e"(1fhC9pWV )17 X 5 V E u E W3dF9534
U. Houston - ECE - 2300
Dave Shattuck University of Houston University of HoustonECE 2300 Circuit Analysis Lecture Set #20 PhasorsDr. Dave Shattuck Associate Professor, ECE Dept.Shattuck@uh.edu 713 743-4422 W326-D3Part 20 Phasors: AC Circuits Background Concepts
U. Houston - ECE - 2300
Name: _ (please print) Signature: _ECE 2300 Quiz #5 April 15, 2009Keep this quiz closed and face up until you are told to begin.1. This quiz is closed book, closed notes. You may use one 8.5" x 11" crib sheet, or its equivalent. 2. Show all wor
Princeton - ASTRO - 528
%!PS-Adobe-2.0 %Creator: dvips 5.58 Copyright 1986, 1994 Radical Eye Software %Title: notes6.dvi %Pages: 4 %PageOrder: Ascend %BoundingBox: 0 0 612 792 %EndComments %DVIPSCommandLine: dvips -o notes6.ps notes6.dvi %DVIPSParameters: dpi=300, comments
Princeton - ASTRO - 528
%!PS-Adobe-2.0 %Creator: dvips 5.58 Copyright 1986, 1994 Radical Eye Software %Title: notes10.dvi %Pages: 2 %PageOrder: Ascend %BoundingBox: 0 0 612 792 %EndComments %DVIPSCommandLine: dvips -o notes10.ps notes10.dvi %DVIPSParameters: dpi=300, commen
Princeton - ASTRO - 589
%!PS-Adobe-2.0 %Creator: dvips(k) 5.86 Copyright 1999 Radical Eye Software %Title: homework2.dvi %Pages: 1 %PageOrder: Ascend %BoundingBox: 0 0 596 842 %EndComments %DVIPSWebPage: (www.radicaleye.com) %DVIPSCommandLine: dvips -o homework2.ps homework