Free Essay

Technological Essays

In:

Submitted By htatetinyu
Words 608
Pages 3
Object-Oriented Programming in C++, Fourth Edition
Robert Lafore

800 East 96th St., Indianapolis, Indiana 46240 USA

Copyright  2002 by Sams Publishing
All rights reserved. No part of this book shall be reproduced, stored in a retrieval system, or transmitted by any means, electronic, mechanical, photocopying, recording, or otherwise, without written permission from the publisher. No patent liability is assumed with respect to the use of the information contained herein. Although every precaution has been taken in the preparation of this book, the publisher and author assume no responsibility for errors or omissions. Nor is any liability assumed for damages resulting from the use of the information contained herein. International Standard Book Number: 0-672-32308-7 Library of Congress Catalog Card Number: 2001094813 Printed in the United States of America First Printing: December 2001 04 03 02 01 4 3 2 1

EXECUTIVE EDITOR
Michael Stephens

ACQUISITIONS EDITOR
Michael Stephens

MANAGING EDITOR
Matt Purcell

PROJECT EDITORS
Angela Boley Christina Smith

INDEXER
Rebecca Salerno

PROOFREADER
Matt Wynalda

Trademarks
All terms mentioned in this book that are known to be trademarks or service marks have been appropriately capitalized. Sams Publishing cannot attest to the accuracy of this information. Use of a term in this book should not be regarded as affecting the validity of any trademark or service mark.

TECHNICAL EDITOR
Mark Cashman

TEAM COORDINATOR
Pamalee Nelson

MEDIA DEVELOPER
Dan Scherf

Warning and Disclaimer
Every effort has been made to make this book as complete and as accurate as possible, but no warranty or fitness is implied. The information provided is on an “as is” basis. The author and the publisher shall have neither liability nor responsibility to any person or entity with respect to any loss or damages arising from the information contained in this book.

INTERIOR DESIGNER
Gary Adair

COVER DESIGNER
Alan Clements

PAGE LAYOUT
Ayanna Lacey

Overview
Introduction 1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 A B C D E F G H The Big Picture 9 C++ Programming Basics 29 Loops and Decisions 75 Structures 131 Functions 161 Objects and Classes 215 Arrays and Strings 263 Operator Overloading 319 Inheritance 371 Pointers 429 Virtual Functions 503 Streams and Files 567 Multifile Programs 633 Templates and Exceptions 681 The Standard Template Library 725 Object-Oriented Software Development 801 ASCII Chart 849 C++ Precedence Table and Keywords 859 Microsoft Visual C++ 863 Borland C++Builder 871 Console Graphics Lite 881 STL Algorithms and Member Functions 895 Answers to Questions and Exercises 913 Bibliography Index 981 977

Contents
Introduction 1 1 The Big Picture 9 Why Do We Need Object-Oriented Programming? ..............................10 Procedural Languages ......................................................................10 The Object-Oriented Approach ........................................................13 Characteristics of Object-Oriented Languages......................................16 Objects ..............................................................................................16 Classes ..............................................................................................18 Inheritance ........................................................................................18 Reusability ........................................................................................21 Creating New Data Types ................................................................21 Polymorphism and Overloading ......................................................21 C++ and C..............................................................................................22 Laying the Groundwork ........................................................................23 The Unified Modeling Language (UML)..............................................23 Summary ................................................................................................25 Questions................................................................................................25 C++ Programming Basics 29 Getting Started ......................................................................................30 Basic Program Construction ..................................................................30 Functions ..........................................................................................31 Program Statements..........................................................................32 Whitespace........................................................................................33 Output Using cout ................................................................................33 String Constants................................................................................34 Directives ..............................................................................................35 Preprocessor Directives ....................................................................35 Header Files......................................................................................35 The using Directive..........................................................................36 Comments ..............................................................................................36 Comment Syntax ..............................................................................36 When to Use Comments ..................................................................37 Alternative Comment Syntax ..........................................................37 Integer Variables ....................................................................................38 Defining Integer Variables................................................................38 Declarations and Definitions ............................................................40 Variable Names ................................................................................40 Assignment Statements ....................................................................40

2

Integer Constants ..............................................................................41 Output Variations ..............................................................................41 The endl Manipulator ......................................................................41 Other Integer Types ..........................................................................42 Character Variables ................................................................................42 Character Constants..........................................................................43 Initialization......................................................................................44 Escape Sequences ............................................................................44 Input with cin ........................................................................................45 Variables Defined at Point of Use ....................................................47 Cascading dimensions; cout > grade; } void showtype() const //display type { cout

Similar Documents

Premium Essay

Engineer

...of change, managers should expect change at any time, and it may last for unspecified lengths of time. Answer: TRUE Diff: 2 Page Ref: 260 Topic: The Change Process 4) Organizational change can be any alterations in people, structure, or technology. Answer: TRUE Diff: 2 Page Ref: 262 Topic: Types of Organizational Change 5) Any manager can be a change agent. Answer: TRUE Diff: 2 Page Ref: 261 Topic: Types of Organizational Change 6) Changing structure includes any change in structural variables such as reporting relationships, coordination mechanisms, employee empowerment, or job redesign. Answer: TRUE Diff: 2 Page Ref: 262 Topic: Types of Organizational Change 7) Computerization is a technological change that replaces people with machines. Answer: FALSE Diff: 2 Page Ref: 262 Topic: Types of Organizational Change Skill: AACSB: Technology 8) Competitive factors or new innovations within an industry often require managers to introduce new equipment, tools, or operating methods. Answer: TRUE Diff: 2 Page Ref: 262 Topic: Types of Organizational Change 9) Probably the most visible technology changes in recent years have come through managers' efforts to expand corporate financing. Answer: FALSE Diff: 2 Page Ref: 262 Topic: Types of Organizational Change Skill: AACSB: Technology 10) Managers used different OD techniques...

Words: 9444 - Pages: 38

Free Essay

Joey's Bar

...Ashton Javier, Director for Facilities and Safety, is in a dilemma on what to do to turn around the company’s warehouse and storage system. III. Objective The primary aim of this analysis is to determine whether demand and inventory are in balance or not in the company and what course of action is to be undertaken to resolve the existing problem on storage and delivery of products. IV. Areas of Consideration 1. Panasonic Philippines, a branded name electronics manufacturer in Pasig, has been one of the leading electronic firms in the country. 2. Their products could not be shipped out of door because of poor storage and delivery system. V. Alternative Courses of Action Advantages | Disadvantages | 1. Technological changes will benefit the company because of its rich and deep stock of content. * Layout Master IV Simulation Software can implement new distribution design * Panasonic was able to increase the customers’ orders daily from 250 to 570 * The Technology eliminates order...

Words: 591 - Pages: 3

Premium Essay

New It Technolgies

...New IT Technologies University of Phoenix CMGT/583 – IS Intergration Instructor: New IT Technologies Technology is constantly changing and evolving which makes it hard for users to keep up. As new developments in technology arise, old ones either stay behind or are incorporated to supplement new ones. This is called convergence. Technological convergence is defined as the combining of two or more different technologies or services to create a new product (). Nowadays, technology convergence has been very successful acting as a stepping stone. Convergence has allowed consumers to enjoy the convenience of incorporating the best features to enjoy a better product. The truth is that technology convergence offers convenience, efficiency and new opportunities to both the consumer and provider (). As consumers, we are constantly looking to buy the latest technological invention or upgrade to the newest technological discovery. It almost seems like a race or competition, consumers are so quick to jump into the newest advance or discovery and often do so without being informed or conducting research. Often, consumers rely on other opinions to help them decide what product they should buy. The Iphone 5 is an excellent example, it’s such a popular item, people are buying it without even testing it out. They don’t know if there are any glitches that need to be fixed. However, consumers are buying...

Words: 742 - Pages: 3

Free Essay

Singularity

...Tanya Leadmon English 111 11/04/13 Singularity When Raymond Kurzweil wrote “The Singularity is Near: When Humans Transcend Biology” in 2005, he predicted that Singularity would occur in the year 2045. Singularity is defined as when computers become smarter than humans. Kurzweil truly believes that this will happen in the year 2045. While reading my critique of Kurzweil’s theory, decide for yourself if you believe Singularity will occur in 2045, or ever. Kurzweil describes his law of accelerating returns as exponential increase in technologies like computers, genetics, nanotechnology and robotics, and artificial intelligence. Kurzweil also predicts that once Singularity has been reached, machine intelligence will be a quintillion times more powerful than all human intelligence combined. Before Singularity can occur, Kurzweil states that there will be exponential growth in evolutionary progress, computational capacity, how the brain works, and revolutions in genetics, nanotechnology, and robotics. Kurzweil believes computational capacity will continue to grow exponentially. He feels that a new paradigm will debut to carry on this growth. According to him, this new paradigm will be nanotubes. He goes on to say that the best way to build machine intelligence is to first understand human intelligence. The first step is to peer inside the brain. Kurzweil predicts that during the 2020’s greater details of the brain will surface because...

Words: 530 - Pages: 3

Premium Essay

Globalization

...The growing impact of ICT on globalisation There is no doubt that scientific advances and technological change have been, are and will remain in the coming years important drivers of the globalisation process. They have been conducive to the creation, distribution and exploitation (in a positive sense of the word) of knowledge in such a manner that they have served as a major source of competitive advantage, wealth creation and improvement in the quality of life. The growing impact of ICT (information and communications technologies) on globalisation can be evidenced by the fact that it has led to a rapid application of recent scientific advances in new products and processes, a high rate of innovation across various countries, as well as a shift to more knowledge-intensive industries and services, together with rising skill requirements. In this day and age there has been a growing realisation that science, technology and innovation have served as the key to improving a nation's economic performance as well as its citizens' social well-being. For this reason government - irrespective of its political ilk and orientation - must serve as a facilitator, enabling business and consumers to adapt to the demands and opportunities of the new economy. When talking of globalisation one must not only assess it as a phenomenon but stock must also be taken of its vital and important policy implications. The impact of policy changes in any one country or region can be translated via...

Words: 1001 - Pages: 5

Premium Essay

Bmgt 301 Midterm

...Chapter 11 Managing Change and Innovation True/False Questions 1. Organizational change refers to the adoption of a new idea or behavior by an organization. Answer: True Level: 1 Page: 392 Type: F 2. Redesign and renewal of the total organization is addressed by operational change. Answer: False Level: 1 Page: 393 Type: F 3. Given that external problems are beyond the control of management, when organizations are caught flat-footed, failing to anticipate or respond to new needs, no one can be blamed. Answer: False Level: 2 Page: 393 Type: F 4. Forces for organizational change exist both in the external environment and within the organization. Answer: True Level: 1 Page: 393 Type: F 5. After the need for change has been perceived, the next part of the change process is implementing change. Answer: False Level: 2 Page: 394 Type: F 6. New department technologies, demands by labor unions, and production inefficiencies are all examples of some external forces. Answer: False Level: 1 Page: 394 Type: F 7. A performance gap is a disparity between the performance of the company when compared with a competitor. Answer: False Level: 3 Page: 395 Type: F 8. The disparity between existing and desired performance levels is the performance gap. Answer: True Level: 1 Page: 395 Type: F 9. The process of learning about current developments inside and outside the organization that can be used to meet...

Words: 5947 - Pages: 24

Free Essay

Week 2 Assignment 1

...What is meant by the term media convergence with regard to technology, and how has it affected everyday life? I believe media convergence with regard to technology is when some forms of media combine together. A perfect example is the internet and telephones we have our now smart phones, or the classic newspaper and television gives us the news, now even combining television and radio whether you listen to the news on the radio or listen to music both are now on the television. These forms of technology among others have affected everyday life by making it so much easier to access everything, convenience is the best way to describe this. When we just had newspapers we had to read to get the news whereas now you turn on the television and have the news read to you while you carry on with your day. When we needed to use the internet to check our e-mail or to look something up we had to go home on get on the computer, but now with smartphones you can access your e-mail where ever you are. Finally with the convergence of radio and television you get such things as the news, MTV, or just the plain music channel where its 24 hours of straight music by genre. If you have noticed all of my examples show how convenient things become when converging forms of media, by converging media it makes life easier for people who are on the go and have busy tight schedules. What is meant by the term media convergence with regard to business, and how has it affected everyday life? What are some...

Words: 301 - Pages: 2

Free Essay

Dromology and Convergence

...produced to increase the speed at which we do things. The difference is that digital technology is increasing not only the speed of the new products, but the speed at which these new products are being produced. Either way it is safe to say that technology and the world revolve around speed. The main goal of every industry is to do things fast and efficiently. Accessing information and communication is already faster than one could have ever imagined. The quest now is to become even faster. Push technology to its limits. In fact, the quest now is to set new limits. Is it plausible to think that we could one day communicate faster than the speed of light? Olympic track athlete Usain Bolt is a good comparison to where we are today as a technological society. His record breaking 100 meters times have reached mythical proportions. It used to be that taller heavier athletes were at a disadvantage in the 100 meters. Their height and weight would work against them, allowing the smaller runner to jump out to a lead that could not be overcome. Bolt however has been blessed with extraordinary ability. He possess the best of both worlds. The speed and quickness of a smaller runner with the power and stride of a bigger one. Technology today possess those same remarkable abilities. The ever popular smart phone is small, fast, but just as powerful as the desktop computer. Current technology gives its user the ability to interact with...

Words: 1348 - Pages: 6

Premium Essay

Impact of Technology

...multitude of changes in our everyday lives over the course of the last decade; arguably as a direct result of technology. We are constantly reminded of the technological advances when attempting to complete the simplest of everyday tasks, viewing entertainment, and all other various forms of entertainment. Nearly everything we do on a daily basis requires some form of technology; cell phones, emailing, vehicles, computers, even schools are all the result of technological advancements that would not have been possible without the significant strides that have been taken in both the business and scientific worlds’. Understanding that technology carries such significance in our lives, can we fathom even just one day without any form of technology? For any business, technology impacts internal and external users alike; companies should take heed to view any new technology they want to implement from all aspects. The company should conduct research to ensure any technological changes will ultimately benefit their customers, employees, and potential customers. One of the most important things to do as a business owner is to ensure that all updated technology is done so in such a way that is conducive to new and repeat business; by maintaining customer awareness, this will aid in the IT team developing the most beneficial technological advances while also discovering new ideas for improvement. * A business should introduce a new product to customers using technology. Technology gives...

Words: 1514 - Pages: 7

Free Essay

Management11111

...| UGB118: Understanding The Business ENIVERONMENT | | UNIVERSITY OF SUNDERLAND, LONDON CAMPUS TEAM MEMBERS: * 139130119{MICHAEL DAMILOLA OLAGBENRO} * 139088348{ABIOLA BANJO} * 129142654{YAKOOB MULLASSERY} * 139131770{OPEYEMI ADEKOLA SADIQ} | [topic:ARE CULTURES CONVERGING ACROSS THE WORLD] | The information and research was provided by the term members | ARE CULTURES CONVERGING ACROSS THE WORLD? INTRODUCTION The best way to describe or explain culture is to have a deep think of people and its natural environment in terms of language, dress style, education and the way people interact with one another in different ways of life. ORIGIN OF CULTURE The inception of society is Atlantis, the lost island, minutely gathering data from aged sources and mythology. (Dietrich, 2014) As regards this investigation, Morocco is one of Atlantis' first states, from where Atlantic culture spread first to Ireland, and to Libya and Egypt. Public opinion spread from West to East, while improvement spread from East to West. He accurately differentiates between pop culture from one viewpoint and human headway on the other: By public opinion he infers religion, divine creatures, myth, science, history, rationale. Public opinion is a significant fact that transcends this world. (Dietrich, 2014) Kauffman proposes an option situation that does not involve the synchronization of various implausible occasions...

Words: 2110 - Pages: 9

Free Essay

Technology Emergence Papaer

...Technology Relationships Paper Brenda Ferguson-Calloway CMGT/557 – Emerging Technologies & Issues November 12, 2012 Ken Orgill Technology Relationships Paper What is leading edge technology? Leading edge technology is “In the 1960s & 70s, leading edge was 3GL languages such as COBOL, Fortran, etc. In the 1980s, 4GLs such as Progress and Informix emerged. In the 1990s, terms such as COM object and 32 bit relational databases were coined” (Pratico, 2008). Since the new millennium began, we have been hearing about HTML, NET and other web languages. What is bleeding edge technology? Bleeding edge technology is “a high-tech product that is so new that its place in the market is still uncertain. The term is applied to products that present a high level of risk because there is some question about how widely they will be accepted” (Web Finance, Inc., 2012). Bleeding technology is relatively, new technology. Bleeding technology is unreliable because it has not been tested and it has not proven its worthiness or authenticity. A user will be taking a huge risk to use the bleeding technology which would be more expensive than the leading technology. Bleeding edge technology could be very costly and it could turn into something that could be the beginning of a serious problem. The reason why bleeding edge technology could cause many problems is because it is new and might be quite risky because of the instability. Bleeding edge technology has not been thoroughly tested and...

Words: 1786 - Pages: 8

Free Essay

Technology: Beneficial or Harmful?

...Michelle Sustayta Professor Elahi English 201 16 July 2013 Technology: Beneficial or Harmful? Throughout the vast history of humanity, humans have always used their innovative and cognitive skills to create tools to better improve their chances at survival on this planet. This technology advancement first began in the Stone Age when man fist discovered that stone could be utilized as both a harvesting tool and hunting weapon; which gradually developed into spears, bows and arrows, and swords. And as time pressed on, one of the most important and influential inventions since the beginning of time was designed in the shape of a circle: the wheel. However, unlike in earlier times, the evolution of technology in the past 60 years has been growing so rapidly that society has scarcely been able to keep up with it on a global scale. And due to this accelerated development of technology, accurate assessment and critical reflection on our dependency of these new technologies has been greatly hindered. So if one were to consider all the consequences and results of today’s technology objectively, could our dependency on modern day technology be viewed as positive or negative outcome? Both sides of this argument have solid, valid claims, but do the pros outweigh the cons or are the benefits of technology not worth the potential harm it can cause to our society. As the advancement of technology drastically rises, society’s dependency for these technologies also rises, however...

Words: 1688 - Pages: 7

Free Essay

Lost in Convience

...Lost in Convenience From the beginning of time people have made advances in technology for the sake of convenience. With the advancements of knowledge in our ever changing world inconvenience has become a thing of the past, or has it? In almost every aspect of one’s life we deal with technology. It is how we deal with that technology decides whether it is useful or not. In this essay, I will address the ways technology has affected my life and the lives of my friends and family through my own observations, experience and actions. Thinking of both convenience and technology in terms of comfort, it can work for us or against us. Technology has taken us away from the discomfort of everyday life that is now a thing of the past. Presently, people no longer know how to be self sufficient; technology has made us incompetent and unable to function without it. The convenience of technology brought us the remote control, so we now no longer get off the couch. Striving for comfort has removed us from the dinner table and into a fast food drive-thru. This quick and easy route has taken us away from quality time spent with the family. Technology has made us lazy, overweight, and unprepared. We have let technology take over our lives with and create a demand that if taken away would topple our society, so much so that people involve every aspect of their life, from their business and their children, with the technology. Now more than ever inventions are being made to make life easier...

Words: 1038 - Pages: 5

Free Essay

La Singularidad

...on the razor edge of the Event Horizon of the Singularity. That this sublime juxtapositional tautology has gone unnoticed until now is itself remarkable. We're so exquisitely privileged to be living in this time, to be born right on the precipice of the greatest paradigm shift in human history, the only thing that approaches the importance of that reality is finding like minds that realize the same, and being able to make some connection with them. If these books have influenced you the same way that they have us, we invite your contact at the email addresses listed below. Enjoy, Michael Beight, piman_314@yahoo.com Steven Reddell, cronyx@gmail.com Here are some new links that we’ve found interesting: KurzweilAI.net News articles, essays, and discussion on the latest topics in technology and accelerating intelligence. SingInst.org The Singularity Institute for Artificial Intelligence: think tank devoted to increasing Humanity’s odds of experiencing a safe, beneficial Singularity. Many interesting articles on such topics as Friendly AI, Existential Risks. A SingInst.org/Media Videos, audio, and PowerPoints from the Singularity Summits; and videos about SIAI’s purpose. blinkx.com/videos/kurzweil Videos on the internet in which the word “Kurzweil” is spoken. Great new resource! PRAISE FOR THE...

Words: 237133 - Pages: 949

Premium Essay

Changes in Technological Progress and Its Contribution to Economic Growth

...Week 8: Current Event Four Changes in Technological Progress and its Contribution to Economic Growth This paper addresses this question by looking at how the behavior of labor productivity grew at a significantly faster rate in the late 90's. The New Economy hypothesis to be examined is whether investment in IT caused the acceleration in productivity. The evidence suggests a growing consensus on two conclusions (Feroli 2001). Information technology is an important factor in the recent acceleration productivity growth (Feroli 2001). Both the production and the use of IT contributed to the productivity revival (Feroli 2001). Information-led development (ILD) most commonly refers to a development strategy whereby a developing country makes a primary economic policy focus the creation and development of a national information technology (IT) sector with the express aim of relying on this sector as an engine of growth (Wikipedia, 2009). While forecasting productivity growth is a chancy and often unsuccessful enterprise, there is some reason to believe that the acceleration in labor productivity could persist for several more years (Feroli 2001). This guarded optimism is informed by recurrent them in the literature that investments in IT manifest themselves in higher productivity with a lag of a few years (Feroli 2001). Information technology can affect aggregate labor productivity through two channels: the production...

Words: 586 - Pages: 3