CS 2605 Lab 8 Spring 2008
|
|
- Trevor Caldwell
- 7 years ago
- Views:
Transcription
1 Inheritance: Logic Gates Goal In this lab, you will consider the use of inheritance in designing and implementing a collection of logic gates. A logic gate is a simple device that receives one or more Boolean values as inputs and produces a Boolean result by combining the inputs using a simple Boolean function. The most common logic gates compute simple Boolean operations. Logic gates may be connected together, using wires, to form larger circuits that compute more complex Boolean functions and even arithmetic results. (That's one reason you'll enjoy CS 2504.) Initially, we will consider a small set of logic gates, implementing the Boolean operations NOT, AND, and OR. Learning Objectives understanding the selection of sensible abstract types for an inheritance hierarchy understanding how to assign responsibilities to the various levels of an inheritance hierarchy experience with the syntax of inheritance experience with simple uses of exceptions exposure to the notion of polymorphism, and how not to achieve it Warmup Analysis of the type relationships To focus the following discussion, let's assume that we will have a Wire type, and that Wire objects will store a Boolean value, and provide a way to set that value and a way to retrieve that value. At this point the details of the interface do not matter. Clearly, we must have classes to represent the three gate types named above. What are the likely attributes and methods for a logic gate? Every logic gate must provide a way to connect one or two input wires and one output wire to itself. Then, the gate will be able to retrieve the value(s) from its input wire(s), and set the value of its output wire. In order to implement complex circuits made up of logic gates, the gate should provide some way to trigger the act of updating its output value. Some logic gates will take one input wire and some will take two. We could consider gates that took more than two inputs, but that doesn't really contribute anything interesting to the inheritance issues, so we will limit our consideration to oneinput and two-input gates. It's certainly possible to derive a two-input gate type from a one-input gate type, but there's no clear advantage in doing so. What is clear is that we have the abstract notion of a "gate", independent of the number of inputs it takes, and of the specific Boolean specific function it evaluates. Here's one possible organization: Gate notgate andgate orgate While this would be workable, it doesn't take advantage of the commonalities we would expect between AND and OR gates. For example, both would provide for two input wires and one output wire. And, it's possible we may think of additional one-input gate types, that might have significant commonality with the NOT gate. So, we will modify our design to incorporate two intermediate abstract types: 1
2 Gate Abstract types oneinputgate twoinputgate notgate andgate orgate Concrete types This will do for now. The Gate class serves only as an anchor for the hierarchy. It doesn't need any data members (we might envision having a zero-input gate type eventually), but it should declare any member functions that are common to all of the derived types (the deep reason for this will become clear later). So, we might settle on something like this: class Gate { Gate() { bool Eval() const; ; The one-input gate type then should add provisions for an input wire and an output wire, with an appropriate constructor, so we might settle on something like this: class OneInputGate : public Gate { OneInputGate(Wire* In = NULL, Wire* Out = NULL); protected: Wire* min; Wire* mout; ; We make the data members protected rather than private, so that the types we derive from this will have access to them. We may provide a specialized version of the inherited Eval() function, but since this is still an abstract type the inherited version is probably sufficient. The two-input gate type would be a simple modification of the one-input gate, adding a second input wire and making the necessary changes to the constructor. Finally we must consider the concrete types. One possible version of the not gate class is shown below. The class must override the inherited Eval() function so that the gate sets its output wire to store the negation of its input wire. class notgate : public OneInputGate { notgate(wire* In = NULL, Wire* Out = NULL) : OneInputGate(In, Out) { ; bool Eval() const; You will find source implementing the specified gates on the Lab page. You should download it and examine the implementations carefully. If there's something in the implementation you don't understand, ask the TAs questions immediately. 2
3 Part I: Incorporating exceptions (weight 25%) The design we arrived at above, and the implementation we provided, are certainly imperfect. For example, what implementation would we provide for the Eval() function in the Gate class? The truth is that since Gate objects cannot have input or output wires, it makes no sense to call the function on one. On the other hand, it seems we must provide an implementation. (We'll see later that 's not really the case.) One possibility would be what's shown in the given code: bool Eval() const { return false; The problem with this is that it's fundamentally dishonest, since it returns a sensible value in response to a nonsensical call. In C++, the idiomatic solution would be to have the function throw an exception if it's called. So, we might provide a specialized kind of object to throw and then modify the implementation of Eval() to throw one of them: class IncompleteGate { IncompleteGate(std::string Msg = "unspecified") { mmsg = Msg; std::string Msg() const { return mmsg; private: std::string mmsg; ; bool Eval() const throw(incompletegate) { throw IncompleteGate("Cannot evaluate abstract gate."); The exception class is based on the design used in the Standard Library for some of the standard exceptions. The thrower can insert an appropriate, specialized message into the thrown object, which could be useful in debugging client code. Decide who will drive during the part of the Lab. Modify the given code to incorporate the exception class (just add it to the Gate header file. Then update the implementation of Eval() as shown above. Now, write a small driver program, declare a Gate object, and call its Eval() function. The program should terminate abnormally when you execute it, since the call to Eval() will result in an exception. Once you've experienced that, rewrite the driver code so that the exception is caught: Gate G; try { G.Eval(); catch (IncompleteGate e) { cout << "Caught exception: " << e.msg() << endl; Now, if you execute your driver, you should see a normal termination after the message is written out by the catch clause. This is as much as you need to know about how to use exceptions, for now. We will discuss further details of C++ exceptions in class. There's no need to modify the implementations of OneInputGate and TwoInputGate, since they will inherit the modified version of Eval() from Gate. But, we do need to modify the concrete gate types since they override Eval(). Basically, we need for those gates to supply versions of Eval() that also throw an exception, but only if the gate object hasn't been provided with a full set of input and output wires. 3
4 Modify the supplied implementations of the concrete gate types so that their Eval() functions also throw an appropriate exception when appropriate. Test your implementation, then zip up the files for your gate classes (but not the driver code) and submit that to the Curator under the heading Lab08PI. Each member of your group must make a submission. Part II: Creating a truly abstract class (weight 25%) The changes specified above will remove one objection to our current implementation. However, it would be even better if we could prevent the client from even creating objects of any of the abstract types. But how can we impose such a restriction? It's actually very simple. If there is no way for the client to call the constructor, then there's no way for the client to declare an object. But, if we were to make the Gate constructor private, then its subtypes could not call it either. (Since the Gate constructor is empty, this may not seem to be a serious objection.) Switch drivers. First, try modifying the Gate class so that its constructor is private. Now compile your code (with the driver you used in Part I). What happens? Modify your driver so that it doesn't declare a Gate object, but it declares one of the concrete gate objects. Now compile your code. What happens? Do you understand why this won't compile? If not, ask for an explanation. OK, making the Gate constructor private isn't an option. But there is another alternative to making the constructor private. Modify your Gate class to use that option and repeat the earlier testing. When you are convinced that it's not possible for client code to declare objects of any of the abstract types, but it is possible to declare objects of the concrete types, move on to Part III. There is no Curator submission for this part. The changes you just made will remain in your code until the end of the Lab. Part III: Adding flexibility and a connectivity test (weight 25%) Switch drivers for this part. The current version of the hierarchy is better, but the interface lacks many useful features. For example, there's no way to change the wires that are connected to a gate after the gate has been created. Fix that by adding member functions with the following interfaces to the hierarchy: bool addwirein(wire* W); bool addwireout(wire* W); There are some important considerations. First, you should add these at the appropriate level(s) in the hierarchy. You should minimize the burden on a future developer who wishes to add new gate classes to the hierarchy. The two-input gates are commutative, so there's no reason to distinguish between "left" and "right" input wires. Second, what should the behavior be if the user tries to add an input wire or output wire and all of the gate's connections are already set? How you answer this question doesn't matter as far as our testing code goes, but you should make a reasoned choice; add comments to your function implementations explaining why you chose your particular design. Now, at this point you may have realized that there's some reason to think of adding another function that tests whether the gate object has been supplied with a full complement of input and output wires. The basic logic for this is probably already in your code at least once. However, we will refine this by specifying what values should be returned under the various possible states of the gate: 4
5 Return value Condition 0 All wires are supplied 1 One input wire is missing 3 Two input wires are missing 4 The output wire is missing 5 One input wire is missing and so is the output wire 7 Two input wires and the output wire are missing The return codes are designed so that a return value of zero indicates success (a fully-connected gate), and other return values indicate the precise nature of the error. This is common practice in C library code. Consider carefully where to add this function within the hierarchy, and then implement it, using the following interface: unsigned int TestConnections(); Test your solution to be sure that it works for each concrete gate type. Then zip up the files for your gate classes (but not the driver code) and submit that to the Curator under the heading Lab08PIII. Each member of your group must make a submission. Part IV: Adding a truth table generator (weight 25%) Switch drivers for this part. The final requirement is to add a function that will generate a complete truth table for a logic gate. For example, when called on an AND gate object, this should return a string that contains the following result: In1 In2 Out false false false false true false true false false true true true You must produce your results in precisely the format shown above. You should use an ostringstream object to write the output to a string and then return that. It might help to know that if you have a bool variable, you can print it as "true" or "false" by using the manipulator boolalpha before you insert the variable to the output stream. It might also be useful to know that you can initialize a bool variable with the values 0 (for false) and 1 (for true). The behavior of the function if the gate isn t fully connected is undefined (and will not be tested). The function must conform to the following interface and should be added in the most appropriate places within the hierarchy: std::string Table() const; If you approach this in the logically correct manner, you will encounter a problem that may seem strange. It s natural to have Table() call Eval(). However, if you place Table() into the appropriate classes, you will find that the calls to Eval() do not perform as expected. If you ve done everything correctly so far, your calls to Eval() will result in the throwing of an exception, because the calls will be to the version of Eval() declared in the Gate class. Modify your declaration of the base class Gate so that the declaration of Gate::Eval() is preceded by the reserved word virtual, something like this: virtual bool Eval() Once you ve made this change, the calls to Eval() in your Table() functions should work as expected. We will discuss why this is necessary in class next week. In fact, if your calls to Eval() work without performing the step above, then you ve placed your implementations of Table() in the wrong classes. In that case, you need to rethink your design decisions. 5
6 When you've completed this part, submit a zipped file containing all your class implementations to the Curator under the heading Lab08PIV. As before, each member of the group must make a submission. Backup Lab Work Before leaving the lab both you and your partner should backup your submitted lab work. It is your responsibility to be able to produce a copy of your work. The Curator server is reasonably reliable, and you can download your submissions from it, but it is always best to maintain your own backups. A USB key or ing yourself a copy of your submitted archive are good options. 6
Basic Logic Gates. Logic Gates. andgate: accepts two binary inputs x and y, emits x & y. orgate: accepts two binary inputs x and y, emits x y
Basic andgate: accepts two binary inputs x and y, emits x & y x y Output orgate: accepts two binary inputs x and y, emits x y x y Output notgate: accepts one binary input x, emits!y x Output Computer Science
More informationC++ INTERVIEW QUESTIONS
C++ INTERVIEW QUESTIONS http://www.tutorialspoint.com/cplusplus/cpp_interview_questions.htm Copyright tutorialspoint.com Dear readers, these C++ Interview Questions have been designed specially to get
More informationJava Interview Questions and Answers
1. What is the most important feature of Java? Java is a platform independent language. 2. What do you mean by platform independence? Platform independence means that we can write and compile the java
More informationFor the next three questions, consider the class declaration: Member function implementations put inline to save space.
Instructions: This homework assignment focuses on basic facts regarding classes in C++. Submit your answers via the Curator System as OQ4. For the next three questions, consider the class declaration:
More informationDecision Logic: if, if else, switch, Boolean conditions and variables
CS 1044 roject 3 Fall 2009 Decision Logic: if, if else, switch, Boolean conditions and variables This programming assignment uses many of the ideas presented in sections 3 through 5 of the Dale/Weems text
More informationThomas Jefferson High School for Science and Technology Program of Studies Foundations of Computer Science. Unit of Study / Textbook Correlation
Thomas Jefferson High School for Science and Technology Program of Studies Foundations of Computer Science updated 03/08/2012 Unit 1: JKarel 8 weeks http://www.fcps.edu/is/pos/documents/hs/compsci.htm
More informationPART-A Questions. 2. How does an enumerated statement differ from a typedef statement?
1. Distinguish & and && operators. PART-A Questions 2. How does an enumerated statement differ from a typedef statement? 3. What are the various members of a class? 4. Who can access the protected members
More informationBoolean Expressions, Conditions, Loops, and Enumerations. Precedence Rules (from highest to lowest priority)
Boolean Expressions, Conditions, Loops, and Enumerations Relational Operators == // true if two values are equivalent!= // true if two values are not equivalent < // true if left value is less than the
More informationBuilding a Multi-Threaded Web Server
Building a Multi-Threaded Web Server In this lab we will develop a Web server in two steps. In the end, you will have built a multi-threaded Web server that is capable of processing multiple simultaneous
More informationCalling the Function. Two Function Declarations Here is a function declared as pass by value. Why use Pass By Reference?
Functions in C++ Let s take a look at an example declaration: Lecture 2 long factorial(int n) Functions The declaration above has the following meaning: The return type is long That means the function
More informationJava (12 Weeks) Introduction to Java Programming Language
Java (12 Weeks) Topic Lecture No. Introduction to Java Programming Language 1 An Introduction to Java o Java as a Programming Platform, The Java "White Paper" Buzzwords, Java and the Internet, A Short
More informationTECHNOLOGY Computer Programming II Grade: 9-12 Standard 2: Technology and Society Interaction
Standard 2: Technology and Society Interaction Technology and Ethics Analyze legal technology issues and formulate solutions and strategies that foster responsible technology usage. 1. Practice responsible
More informationAppendix K Introduction to Microsoft Visual C++ 6.0
Appendix K Introduction to Microsoft Visual C++ 6.0 This appendix serves as a quick reference for performing the following operations using the Microsoft Visual C++ integrated development environment (IDE):
More informationWhat is a Loop? Pretest Loops in C++ Types of Loop Testing. Count-controlled loops. Loops can be...
What is a Loop? CSC Intermediate Programming Looping A loop is a repetition control structure It causes a single statement or a group of statements to be executed repeatedly It uses a condition to control
More informationOperator Overloading. Lecture 8. Operator Overloading. Running Example: Complex Numbers. Syntax. What can be overloaded. Syntax -- First Example
Operator Overloading Lecture 8 Operator Overloading C++ feature that allows implementer-defined classes to specify class-specific function for operators Benefits allows classes to provide natural semantics
More informationConditions & Boolean Expressions
Conditions & Boolean Expressions 1 In C++, in order to ask a question, a program makes an assertion which is evaluated to either true (nonzero) or false (zero) by the computer at run time. Example: In
More informationSpecialized Programme on Web Application Development using Open Source Tools
Specialized Programme on Web Application Development using Open Source Tools Objective: At the end of the course, Students will be able to: Understand various open source tools(programming tools and databases)
More informationIndependent samples t-test. Dr. Tom Pierce Radford University
Independent samples t-test Dr. Tom Pierce Radford University The logic behind drawing causal conclusions from experiments The sampling distribution of the difference between means The standard error of
More informationCommon Beginner C++ Programming Mistakes
Common Beginner C++ Programming Mistakes This documents some common C++ mistakes that beginning programmers make. These errors are two types: Syntax errors these are detected at compile time and you won't
More informationC++ Programming Language
C++ Programming Language Lecturer: Yuri Nefedov 7th and 8th semesters Lectures: 34 hours (7th semester); 32 hours (8th semester). Seminars: 34 hours (7th semester); 32 hours (8th semester). Course abstract
More informationSources: On the Web: Slides will be available on:
C programming Introduction The basics of algorithms Structure of a C code, compilation step Constant, variable type, variable scope Expression and operators: assignment, arithmetic operators, comparison,
More information1 Description of The Simpletron
Simulating The Simpletron Computer 50 points 1 Description of The Simpletron In this assignment you will write a program to simulate a fictional computer that we will call the Simpletron. As its name implies
More informationCS 111 Classes I 1. Software Organization View to this point:
CS 111 Classes I 1 Software Organization View to this point: Data Objects and primitive types Primitive types operators (+, /,,*, %). int, float, double, char, boolean Memory location holds the data Objects
More informationCounters and Decoders
Physics 3330 Experiment #10 Fall 1999 Purpose Counters and Decoders In this experiment, you will design and construct a 4-bit ripple-through decade counter with a decimal read-out display. Such a counter
More informationPROBLEM SOLVING SEVENTH EDITION WALTER SAVITCH UNIVERSITY OF CALIFORNIA, SAN DIEGO CONTRIBUTOR KENRICK MOCK UNIVERSITY OF ALASKA, ANCHORAGE PEARSON
PROBLEM SOLVING WITH SEVENTH EDITION WALTER SAVITCH UNIVERSITY OF CALIFORNIA, SAN DIEGO CONTRIBUTOR KENRICK MOCK UNIVERSITY OF ALASKA, ANCHORAGE PEARSON Addison Wesley Boston San Francisco New York London
More informationFundamentals of Java Programming
Fundamentals of Java Programming This document is exclusive property of Cisco Systems, Inc. Permission is granted to print and copy this document for non-commercial distribution and exclusive use by instructors
More informationCS106B Handout #5P Winter 07-08 January 14, 2008
CS106B Handout #5P Winter 07-08 January 14, 2008 Using Microsoft Visual Studio 2005 Many thanks to Matt Ginzton, Robert Plummer, Erik Neuenschwander, Nick Fang, Justin Manus, Andy Aymeloglu, Pat Burke,
More informationRead this syllabus very carefully. If there are any reasons why you cannot comply with what I am requiring, then talk with me about this at once.
LOGIC AND CRITICAL THINKING PHIL 2020 Maymester Term, 2010 Daily, 9:30-12:15 Peabody Hall, room 105 Text: LOGIC AND RATIONAL THOUGHT by Frank R. Harrison, III Professor: Frank R. Harrison, III Office:
More informationHow to test and debug an ASP.NET application
Chapter 4 How to test and debug an ASP.NET application 113 4 How to test and debug an ASP.NET application If you ve done much programming, you know that testing and debugging are often the most difficult
More informationName: Class: Date: 9. The compiler ignores all comments they are there strictly for the convenience of anyone reading the program.
Name: Class: Date: Exam #1 - Prep True/False Indicate whether the statement is true or false. 1. Programming is the process of writing a computer program in a language that the computer can respond to
More informationUser guide for the Error & Warning LabVIEW toolset
User guide for the Error & Warning LabVIEW toolset Rev. 2014 December 2 nd 2014 1 INTRODUCTION... 1 2 THE LABVIEW ERROR CLUSTER... 2 2.1 The error description... 3 2.2 Custom error descriptions... 4 3
More informationCHAPTER 2. Logic. 1. Logic Definitions. Notation: Variables are used to represent propositions. The most common variables used are p, q, and r.
CHAPTER 2 Logic 1. Logic Definitions 1.1. Propositions. Definition 1.1.1. A proposition is a declarative sentence that is either true (denoted either T or 1) or false (denoted either F or 0). Notation:
More informationQuick Start Articles provide fast answers to frequently asked questions. Quick Start Article
FullControl Network Inc. Quick Start Article "The Ins and Outs of FTP OVERVIEW: ARTICLE: AUTHOR: QS41352 The 10 second description for those coming in brand new is: For those running a version of Windows
More informationLab 2: Swat ATM (Machine (Machine))
Lab 2: Swat ATM (Machine (Machine)) Due: February 19th at 11:59pm Overview The goal of this lab is to continue your familiarization with the C++ programming with Classes, as well as preview some data structures.
More informationwww.virtualians.pk CS506 Web Design and Development Solved Online Quiz No. 01 www.virtualians.pk
CS506 Web Design and Development Solved Online Quiz No. 01 Which of the following is a general purpose container? JFrame Dialog JPanel JApplet Which of the following package needs to be import while handling
More informationLogic in Computer Science: Logic Gates
Logic in Computer Science: Logic Gates Lila Kari The University of Western Ontario Logic in Computer Science: Logic Gates CS2209, Applied Logic for Computer Science 1 / 49 Logic and bit operations Computers
More informationEmbedded Programming in C/C++: Lesson-1: Programming Elements and Programming in C
Embedded Programming in C/C++: Lesson-1: Programming Elements and Programming in C 1 An essential part of any embedded system design Programming 2 Programming in Assembly or HLL Processor and memory-sensitive
More informationJava Application Developer Certificate Program Competencies
Java Application Developer Certificate Program Competencies After completing the following units, you will be able to: Basic Programming Logic Explain the steps involved in the program development cycle
More informationWHY AND HOW TO REVISE
Page 1 of 5 Revising Your Paper WHY AND HOW TO REVISE Most of us who compose on a computer understand revision as an ongoing, even constant process. Every time you hit the delete button, every time you
More informationCompile-time type versus run-time type. Consider the parameter to this function:
CS107L Handout 07 Autumn 2007 November 16, 2007 Advanced Inheritance and Virtual Methods Employee.h class Employee public: Employee(const string& name, double attitude, double wage); virtual ~Employee();
More informationSequential Program Execution
Sequential Program Execution Quick Start Compile step once always g++ -o Realtor1 Realtor1.cpp mkdir labs cd labs Execute step mkdir 1 Realtor1 cd 1 cp../0/realtor.cpp Realtor1.cpp Submit step cp /samples/csc/155/labs/1/*.
More informationC++ Language Tutorial
cplusplus.com C++ Language Tutorial Written by: Juan Soulié Last revision: June, 2007 Available online at: http://www.cplusplus.com/doc/tutorial/ The online version is constantly revised and may contain
More informationLecture J - Exceptions
Lecture J - Exceptions Slide 1 of 107. Exceptions in Java Java uses the notion of exception for 3 related (but different) purposes: Errors: an internal Java implementation error was discovered E.g: out
More informationSpecialized Programme on Web Application Development using Open Source Tools
Specialized Programme on Web Application Development using Open Source Tools A. NAME OF INSTITUTE Centre For Development of Advanced Computing B. NAME/TITLE OF THE COURSE C. COURSE DATES WITH DURATION
More information1 of 1 24/05/2013 10:23 AM
?Init=Y 1 of 1 24/05/2013 10:23 AM 1. Which of the following correctly defines a queue? a list of elements with a first in last out order. a list of elements with a first in first out order. (*) something
More informationAn Incomplete C++ Primer. University of Wyoming MA 5310
An Incomplete C++ Primer University of Wyoming MA 5310 Professor Craig C. Douglas http://www.mgnet.org/~douglas/classes/na-sc/notes/c++primer.pdf C++ is a legacy programming language, as is other languages
More informationAppendix M: Introduction to Microsoft Visual C++ 2010 Express Edition
Appendix M: Introduction to Microsoft Visual C++ 2010 Express Edition This book may be ordered from Addison-Wesley in a value pack that includes Microsoft Visual C++ 2010 Express Edition. Visual C++ 2010
More informationSection 4.1 Rules of Exponents
Section 4.1 Rules of Exponents THE MEANING OF THE EXPONENT The exponent is an abbreviation for repeated multiplication. The repeated number is called a factor. x n means n factors of x. The exponent tells
More informationQuotes from Object-Oriented Software Construction
Quotes from Object-Oriented Software Construction Bertrand Meyer Prentice-Hall, 1988 Preface, p. xiv We study the object-oriented approach as a set of principles, methods and tools which can be instrumental
More informationHow To Program In Scheme (Prolog)
The current topic: Scheme! Introduction! Object-oriented programming: Python Functional programming: Scheme! Introduction Next up: Numeric operators, REPL, quotes, functions, conditionals Types and values
More informationAP Computer Science Java Subset
APPENDIX A AP Computer Science Java Subset The AP Java subset is intended to outline the features of Java that may appear on the AP Computer Science A Exam. The AP Java subset is NOT intended as an overall
More informationSoftware documentation systems
Software documentation systems Basic introduction to various user-oriented and developer-oriented software documentation systems. Ondrej Holotnak Ondrej Jombik Software documentation systems: Basic introduction
More informationECE 122. Engineering Problem Solving with Java
ECE 122 Engineering Problem Solving with Java Introduction to Electrical and Computer Engineering II Lecture 1 Course Overview Welcome! What is this class about? Java programming somewhat software somewhat
More informationImport itunes Library to Surface
Import itunes Library to Surface Original Post: June 25, 2013 Windows 8.0 If you ve been wondering how to import your itunes library and playlists to your Surface, this post is for you. I ll cover how
More informationC++ Programming: From Problem Analysis to Program Design, Fifth Edition. Chapter 3: Input/Output
C++ Programming: From Problem Analysis to Program Design, Fifth Edition Chapter 3: Input/Output Objectives In this chapter, you will: Learn what a stream is and examine input and output streams Explore
More informationChapter 5. Selection 5-1
Chapter 5 Selection 5-1 Selection (Decision) The second control logic structure is selection: Selection Choosing between two or more alternative actions. Selection statements alter the sequential flow
More informationComputer Programming C++ Classes and Objects 15 th Lecture
Computer Programming C++ Classes and Objects 15 th Lecture 엄현상 (Eom, Hyeonsang) School of Computer Science and Engineering Seoul National University Copyrights 2013 Eom, Hyeonsang All Rights Reserved Outline
More informationBinary Adders: Half Adders and Full Adders
Binary Adders: Half Adders and Full Adders In this set of slides, we present the two basic types of adders: 1. Half adders, and 2. Full adders. Each type of adder functions to add two binary bits. In order
More informationBasics of I/O Streams and File I/O
Basics of This is like a cheat sheet for file I/O in C++. It summarizes the steps you must take to do basic I/O to and from files, with only a tiny bit of explanation. It is not a replacement for reading
More information1 Abstract Data Types Information Hiding
1 1 Abstract Data Types Information Hiding 1.1 Data Types Data types are an integral part of every programming language. ANSI-C has int, double and char to name just a few. Programmers are rarely content
More informationChapter One Introduction to Programming
Chapter One Introduction to Programming 1-1 Algorithm and Flowchart Algorithm is a step-by-step procedure for calculation. More precisely, algorithm is an effective method expressed as a finite list of
More informationIntro to Web Programming. using PHP, HTTP, CSS, and Javascript Layton Smith CSE 4000
Intro to Web Programming using PHP, HTTP, CSS, and Javascript Layton Smith CSE 4000 Intro Types in PHP Advanced String Manipulation The foreach construct $_REQUEST environmental variable Correction on
More informationCode Kingdoms Learning a Language
codekingdoms Code Kingdoms Unit 2 Learning a Language for kids, with kids, by kids. Resources overview We have produced a number of resources designed to help people use Code Kingdoms. There are introductory
More informationEl Dorado Union High School District Educational Services
El Dorado Union High School District Course of Study Information Page Course Title: ACE Computer Programming II (#495) Rationale: A continuum of courses, including advanced classes in technology is needed.
More informationProgramming and Software Development (PSD)
Programming and Software Development (PSD) Course Descriptions Fundamentals of Information Systems Technology This course is a survey of computer technologies. This course may include computer history,
More informationIBM Tivoli Workload Scheduler Integration Workbench V8.6.: How to customize your automation environment by creating a custom Job Type plug-in
IBM Tivoli Workload Scheduler Integration Workbench V8.6.: How to customize your automation environment by creating a custom Job Type plug-in Author(s): Marco Ganci Abstract This document describes how
More informationReading and Writing PCD Files The PCD File Format The Grabber Interface Writing a Custom Grabber PCL :: I/O. Suat Gedikli, Nico Blodow
PCL :: I/O Suat Gedikli, Nico Blodow July 1, 2011 Outline 1. Reading and Writing PCD Files 2. The PCD File Format 3. The Grabber Interface 4. Writing a Custom Grabber global functions in the namespace
More informationPassing 1D arrays to functions.
Passing 1D arrays to functions. In C++ arrays can only be reference parameters. It is not possible to pass an array by value. Therefore, the ampersand (&) is omitted. What is actually passed to the function,
More informationNot agree with bug 3, precision actually was. 8,5 not set in the code. Not agree with bug 3, precision actually was
Task 1 Task 2 Task 3 Feedback Presence SUM Matrikkel Rühm [5] [1] [2] [1] [1] [10] Feedback to students A64129 1. rühm 0 0 No submission found A72068 1. rühm 5 1 2 1 1 For Bug 3. Actually the variable
More informationMultichoice Quetions 1. Atributes a. are listed in the second part of the class box b. its time is preceded by a colon. c. its default value is
Multichoice Quetions 1. Atributes a. are listed in the second part of the class box b. its time is preceded by a colon. c. its default value is preceded by an equal sign d. its name has undereline 2. Associations
More informationVisual Basic 6 Error Handling
Visual Basic 6 Error Handling Try as hard as you might, it's virtually impossible to make the programs you write foolproof. Sad to say, programs bomb, that is ungracefully come to a grinding halt---and
More informationComputing Concepts with Java Essentials
2008 AGI-Information Management Consultants May be used for personal purporses only or by libraries associated to dandelon.com network. Computing Concepts with Java Essentials 3rd Edition Cay Horstmann
More informationCpSc212 Goddard Notes Chapter 6. Yet More on Classes. We discuss the problems of comparing, copying, passing, outputting, and destructing
CpSc212 Goddard Notes Chapter 6 Yet More on Classes We discuss the problems of comparing, copying, passing, outputting, and destructing objects. 6.1 Object Storage, Allocation and Destructors Some objects
More informationWriting an essay. This seems obvious - but it is surprising how many people don't really do this.
Writing an essay Look back If this is not your first essay, take a look at your previous one. Did your tutor make any suggestions that you need to bear in mind for this essay? Did you learn anything else
More informationThe first time through running an Ad Hoc query or Stored Procedure, SQL Server will go through each of the following steps.
SQL Query Processing The first time through running an Ad Hoc query or Stored Procedure, SQL Server will go through each of the following steps. 1. The first step is to Parse the statement into keywords,
More informationearlier in the semester: The Full adder above adds two bits and the output is at the end. So if we do this eight times, we would have an 8-bit adder.
The circuit created is an 8-bit adder. The 8-bit adder adds two 8-bit binary inputs and the result is produced in the output. In order to create a Full 8-bit adder, I could use eight Full -bit adders and
More informationIntroduction to Python
Caltech/LEAD Summer 2012 Computer Science Lecture 2: July 10, 2012 Introduction to Python The Python shell Outline Python as a calculator Arithmetic expressions Operator precedence Variables and assignment
More informationARIZONA CTE CAREER PREPARATION STANDARDS & MEASUREMENT CRITERIA SOFTWARE DEVELOPMENT, 15.1200.40
SOFTWARE DEVELOPMENT, 15.1200.40 STANDARD 1.0 APPLY PROBLEM-SOLVING AND CRITICAL THINKING SKILLS TO INFORMATION 1.1 Describe methods of establishing priorities 1.2 Prepare a plan of work and schedule information
More informationMS Visual C++ Introduction. Quick Introduction. A1 Visual C++
MS Visual C++ Introduction 1 Quick Introduction The following pages provide a quick tutorial on using Microsoft Visual C++ 6.0 to produce a small project. There should be no major differences if you are
More informationCourse MS10975A Introduction to Programming. Length: 5 Days
3 Riverchase Office Plaza Hoover, Alabama 35244 Phone: 205.989.4944 Fax: 855.317.2187 E-Mail: rwhitney@discoveritt.com Web: www.discoveritt.com Course MS10975A Introduction to Programming Length: 5 Days
More informationWebsite Maintenance Information For My Clients Bob Spies, Flying Seal Systems, LLC Updated: 08- Nov- 2015
Website Maintenance Information For My Clients Bob Spies, Flying Seal Systems, LLC Updated: 08- Nov- 2015 This document has several purposes: To explain what website maintenance is and why it's critical
More informationUpgrading from Windows XP to Windows 7
We highly recommend that you print this tutorial. Your PC will restart during the Windows 7 installation process, so having a printed copy will help you follow the steps if you're unable to return to this
More information1. The most dominant detail (after you found it) 2. The feelings in your body
Introduction to the PMA Self- help technique How do you do an effective PMA session on yourself? What do you have to do and what do you have to avoid? Progressive Mental Alignment (PMA) makes use of the
More informationOutlook 2007: Managing your mailbox
Outlook 2007: Managing your mailbox Find its size and trim it down Use Mailbox Cleanup On the Tools menu, click Mailbox Cleanup. You can do any of the following from this one location: View the size of
More informationIntroduction to C++ Introduction to C++ Week 7 Dr Alex Martin 2013 Slide 1
Introduction to C++ Introduction to C++ Week 7 Dr Alex Martin 2013 Slide 1 Introduction to Classes Classes as user-defined types We have seen that C++ provides a fairly large set of built-in types. e.g
More informationMath: Study Skills, Note Taking Skills, And Test Taking Strategies
Math: Study Skills, Note Taking Skills, And Test Taking Strategies Math Study Skill Active Study vs. Passive Study Be actively involved in managing the learning process, the mathematics and your study
More informationMetacognition. Complete the Metacognitive Awareness Inventory for a quick assessment to:
Metacognition Metacognition is essential to successful learning because it enables individuals to better manage their cognitive skills and to determine weaknesses that can be corrected by constructing
More informationSelect the Crow s Foot entity relationship diagram (ERD) option. Create the entities and define their components.
Α DESIGNING DATABASES WITH VISIO PROFESSIONAL: A TUTORIAL Microsoft Visio Professional is a powerful database design and modeling tool. The Visio software has so many features that we can t possibly demonstrate
More informationCHAPTER 3 Boolean Algebra and Digital Logic
CHAPTER 3 Boolean Algebra and Digital Logic 3.1 Introduction 121 3.2 Boolean Algebra 122 3.2.1 Boolean Expressions 123 3.2.2 Boolean Identities 124 3.2.3 Simplification of Boolean Expressions 126 3.2.4
More informationChapter 1 Java Program Design and Development
presentation slides for JAVA, JAVA, JAVA Object-Oriented Problem Solving Third Edition Ralph Morelli Ralph Walde Trinity College Hartford, CT published by Prentice Hall Java, Java, Java Object Oriented
More informationThe HTTP Plug-in. Table of contents
Table of contents 1 What's it for?... 2 2 Controlling the HTTPPlugin... 2 2.1 Levels of Control... 2 2.2 Importing the HTTPPluginControl...3 2.3 Setting HTTPClient Authorization Module... 3 2.4 Setting
More informationThe Basics of Dynamic SAS/IntrNet Applications Roderick A. Rose, Jordan Institute for Families, School of Social Work, UNC-Chapel Hill
Paper 5-26 The Basics of Dynamic SAS/IntrNet Applications Roderick A. Rose, Jordan Institute for Families, School of Social Work, UNC-Chapel Hill ABSTRACT The purpose of this tutorial is to introduce SAS
More informationIntroduction Object-Oriented Network Programming CORBA addresses two challenges of developing distributed systems: 1. Making distributed application development no more dicult than developing centralized
More informationGates, Circuits, and Boolean Algebra
Gates, Circuits, and Boolean Algebra Computers and Electricity A gate is a device that performs a basic operation on electrical signals Gates are combined into circuits to perform more complicated tasks
More informationWriting Thesis Defense Papers
Writing Thesis Defense Papers The point of these papers is for you to explain and defend a thesis of your own critically analyzing the reasoning offered in support of a claim made by one of the philosophers
More informationAndroid Programming Family Fun Day using AppInventor
Android Programming Family Fun Day using AppInventor Table of Contents A step-by-step guide to making a simple app...2 Getting your app running on the emulator...9 Getting your app onto your phone or tablet...10
More informationThe Peruvian coin flip Cryptographic protocols
Activity 17 The Peruvian coin flip Cryptographic protocols Age group Older elementary and up. Abilities assumed Requires counting, and recognition of odd and even numbers. Some understanding of the concepts
More information3 Improving the Crab more sophisticated programming
3 Improving the Crab more sophisticated programming topics: concepts: random behavior, keyboard control, sound dot notation, random numbers, defining methods, comments In the previous chapter, we looked
More informationSection 1: Ribbon Customization
WHAT S NEW, COMMON FEATURES IN OFFICE 2010 2 Contents Section 1: Ribbon Customization... 4 Customizable Ribbon... 4 Section 2: File is back... 5 Info Tab... 5 Recent Documents Tab... 7 New Documents Tab...
More informationDesigning with Exceptions. CSE219, Computer Science III Stony Brook University http://www.cs.stonybrook.edu/~cse219
Designing with Exceptions CSE219, Computer Science III Stony Brook University http://www.cs.stonybrook.edu/~cse219 Testing vs. Debugging Testing Coding Does the code work properly YES NO 2 Debugging Testing
More information