Free Essay

Object Oriented Data and Processes

In: Computers and Technology

Submitted By joejoe
Words 290
Pages 2
Main Module Call get materials module Call microwave module Call mix materials module
End Main Module
Get Material Module Get coffee cup Get Instant coffee Get cream Get sugar Fill coffee cup with water
End Get Material Module
Microwave Module Set coffee cup in microwave Set microwave temp=High Set time=2min Start Microwave While Microwave = not done Wait patently End While Remove coffee cup
End Microwave Module
Mix Materials Module Set 1 pack instant coffee+ 2 tbs cream+ 2 sugar cubes= CupofCoffee While CupofCoffee = Black color Stir coffee counter clockwise End While
End Mix Materials Module
An example of how to write this program in an object oriented way would be,
Class Make cup of instant coffee Subprogram Get Material Get coffee cup Get Instant coffee Get cream Get sugar Fill coffee cup with water End subprogram Subprogram Microwave Set coffee cup in microwave Set microwave temp=High Set time=2min Start Microwave While Microwave = not done Wait patently End While Remove coffee cup End subprogram Subprogram Mix Materials Set 1 pack instant coffee+ 2 tbs cream+ 2 sugar cubes= CupofCoffee While CupofCoffee = Black color Stir coffee counter clockwise End While End subprogram
End Class

I am using the cup of coffee as the object and the components that make the coffee as subprograms within the object. The difference between object oriented and structured is structured follows a series of steps laid out in order of importance. An object oriented program focuses on the object and how its data and operations make up the object. To me structured makes more sense it is easier for me to visualize a step by step order rather than focusing on one object and how other operations and data affect that object.…...

Similar Documents

Free Essay

Wek 8 Object Oriented Programming

...Flavors Display “Is this correct? Yes = Y or No = N” Else Display “You have not chosen a correct Flavor” End IF Display “How Many Packs of Kool-Aid did you use? 1 or 2” Input userSugar IF userSugar = “1” Set userWater = newOnePack IF userSugar = “2” Set userWater = newTwoPack End IF Display “Would you like to make more Kool-aid? yes or no” Input yes End While End Program I believe I enjoy object oriented programming a lot more then structured because with OOP I can develop classes to store the data rather than using modules to call the functions that I am using I can just use the class file and create a new variable and inherit the attributes of the class file without having to store multiple lines of code to develop the same process and I can also use multiples of the same class with different variable names and label them as different functions and names OOP is used in game programming to store data regarding players and monsters movements, attacks, and items they can carry. Structured programming is good to use when creating smaller programs with little features with the program itself....

Words: 390 - Pages: 2

Free Essay

Object Oriented Programming Exam

...SAMPLE QUESTION PAPER Object Oriented Programming using Java SEMESTER 1& 2 Question 1 (25 marks) a) Discuss the syntax, purpose and application, with an example for each, of the following: i. if ii. while iii. for iv. switch (4 x 5 marks = 20 marks) b) Write an independent Java method that accepts three sides of a triangle, say a, b and c and returns “Equilateral” if all the three sides are equal, “Isosceles” if any two sides are equal “Scalene” otherwise. (5 marks) Question 2 (25 marks) a) Write an independent Java method that accepts an integer and returns true if it is a prime number, false otherwise. An integer is said to be prime if it is divisible by 1 and itself only. (9 marks) b) Write an independent Java method that accepts an array of integers and returns the smallest of them. (8 marks) c) Write a Java program to accept 10 integers and print the sum of numbers divisible by 5. (8 marks) Question 3 (25 marks) a) Write a Java program to print the sum, average, maximum and minimum of 10 numbers. All numbers must be read from the user. (8 marks) b) What are formal and actual arguments? Explain with a sample program how they work in Java. (8 marks) c) Write a Java program to print first n Fibonacci sequence of numbers. The first two numbers of the sequence are 0 and 1; next number is the sum of the previous numbers. (9 marks) ...

Words: 731 - Pages: 3

Free Essay

It/218 Object Oriented Programming

...Object oriented programming refers to a method of programming in which individual objects, usually called "methods" and "functions", are created and used in junction with each other to perform a function. These objects are organized within the program through use of things called structures or classes. A class is something we use to create a blueprint of sorts for a assortment of variables and components. Similarly, a structure serves the same purpose. The only difference between a structure and a class is that a structure's members are public by default and a classes members are private by default. Another form of "blueprint" used by programmers is the data union. While a union is very primitive in comparison to a structure or class, it is a good tool to use to conserve memory in larger applications. A union uses the same memory block for multiple variables at different points. While two variables in a union cannot be accessed at the same time, a union is a good way to re-use blocks of memory that would normally be left void after a variable is finished with. Now that I have covered the basic points of classes, structures and unions, I will go into more detail of just how powerful a class or structure can be. In basic reference, a class is simply a blueprint to something we create instances of later in the program. This is a very vague statement however, because in object-oriented programming the class is the backbone of the program. It is what makes......

Words: 813 - Pages: 4

Premium Essay

Pt1420 Object Oriented Programing

...Object Oriented Programming Object-oriented programming or OOP is a programming paradigm that represents concepts as “objects” that have attributes that describe the objects and associated procedures known as methods. Objects, which are usually instances of classes, are used to interact with one another to design applications and computer programs. Some advantages of OOP are it provides a clear modular structure for programs which makes it good for defining abstract data types where implementation details are hidden and the unit has a clearly defined interface. It makes it easy to maintain and modify existing code as new objects can be created with small differences to existing ones. And it provides a good framework for code libraries where supplied software components can be easily adapted and modified by the programmer. Some disadvantages are that OOP can be larger than other programs. In the early days of computing, space on hard drives, floppy drives and in memory was at a premium which meant that more money was going to be spent. Another is that it requires a lot of work to create. A great deal of planning goes into an object oriented program well before a single piece of code is ever written. Initially, this early effort was felt by many to be a waste of time. Finally OOP were slower than other programs, partially because of their size. Other aspects of OOP demand more system resources, thus slowing the program down. REST and CRUD CRUD specifies a minimal set...

Words: 367 - Pages: 2

Premium Essay

Object Oriented lab. Part 2 – Designing databases Review and Definitions: * The hierarchy of data begins with a character, a collection of related characters is a field, a collection of related fields is a record, a collection of related records is a file, and a collection of related files is a database. Example of fields used in a student database would be “Last Name”, “First Name”, “SSN”, “Major”, and “GPA”. A record in a student database would be all of the fields for one student. A file would be a grouping of all the records for students in a particular course. A database would be a collection of all the files for all courses. * A primary key is a field that contains data unique to a record. Duplicate data cannot be entered into a field that is designated a primary key. Unique data such as social security numbers, student ID numbers, and part numbers are examples of fields that can be designated as primary keys. * A relationship is an association between data that is stored in different record types. For example, a student would have information on the classes he is taking in the course file. There will be another file that contains personal information, such as address. Both files will use the student’s id number as the unique identifier or primary key. These two files can be related by using the student’s id number. 1. Design a table for the following Employee data. Use the table on the next page for defining each field. I’ve done the first field for......

Words: 755 - Pages: 4

Premium Essay

Object Oriented Programming

...Object Oriented Programming IT/218 Object-Oriented Programming (OOP) provides computer programmers not only a new way to program, but a new way to think in terms of objects. This type of programming (“Object oriented programming,” 2012) allows programmers to use objects as a way of thought versus using a procedural language and organizing by data structures and algorithms. This is a new way of programming centered on objects to develop programs. C++ gives the programmer a way to incorporate encapsulation, inheritance, and polymorphorism and C++ also provides many ways of support Object-Oriented Programming. Programming was once thought upon as using a series of tasks for the computer to perform but object-oriented programming uses a collection of objects. In this type of programming, each object can receive message and process data, as well as send other messages to fellow objects. By placing information where it is not accessible by the entire computer program, OOP (“Object oriented programming,” 2012) calls the data using methods. The methods then act as intermediaries for working on the data they control. Object-oriented programs center on different types of objects. Each object contains a kind of data that manages the information within the program itself. The method of the object will use a system of checks and safeguards that are defined in the types of data the object contains. Because of this system, adaptations to the program can......

Words: 465 - Pages: 2

Premium Essay

Object-Oriented vs. Procedural Programming

...Object-Oriented vs. Procedural Programming Whether it is Object-Oriented or Procedural Programming, programming in general is dealing with or looking at data and the code that can and will change the data (output) in some way. Object-Oriented vs. Procedural Programming can be said to be ways we handle the coding of the data – how it is written perhaps. We need to apply different thinking and strategies when we write code, and it can be either Object-Oriented or Procedural Programming. In Procedural Programming, we group our code into procedures, hence the name Procedural Programming. These procedures are instructions on how we use and manipulate the data. With Procedural Programming we have code that is read line by line, taking input (instructions) to do something with the goal of an output. The code is read (data taken in) in exchange for an output. With Procedural Programming, you can write code all day long that do not have an existing relationship to the data used. Procedural Programming functions use code (data) provided and can access shared data needed, but a relationship does not exist. Procedural Programming uses traditional programming languages like C, COBOL and Pascal. In short, Procedural Programming is about using and choosing data structures, creating your algorithms, and converting algorithms into code. With Procedural Programming, data and operations of the data or with the data are separate (no relationship exist). You send data to procedures...

Words: 720 - Pages: 3

Free Essay

Object-Oriented Analysis and Design

...Generic Exam: Object-Oriented Analysis and Design Time: 2.5 hours Marking: 100 marks, plus 10 marks for the bonus question. Purpose This purpose of this generic exam is to allow you to see what the real final exam will look like, and the relative weighting in terms of marks. The only significant difference between this generic exam and the final one is that the latter will include a specific case study. Exam Process This examination is composed of multiple sections. Each subsequent section relies upon standard solutions from the previous sections. You are required to submit your section answers—on completion—to the examination coordinator, and trade it for the standard solution. Use the provided standard solution as the basis for your subsequent work. On completion of the examination, hand in the entire set of standard solutions. Do not reveal or discuss the standard solutions, either during or after the examination. Marking ▪ Please note that the use case questions have the least marks, since they are relatively straightforward and not an object-oriented skill. In contrast, the questions on responsibility assignment, patterns, and design of collaborations have the most marks, since these are the most important object-oriented design skills. Evaluation Objectives ▪ Ability to identify primary use cases and record them in expanded, essential form. ▪ Ability to identify outstanding concepts, associations, and attributes......

Words: 688 - Pages: 3

Premium Essay

Object Oriented Programming and Uml

...Object Oriented Programming and UML Implementation modeling is “the development stage for adding fine details to a model that transcend languages. Implementation modeling is the immediate precursor to the actual implementation.”(Blaha & Rambaugh, 2005) Implementation modeling uses the following four steps: fine-tune classes, fine-tune generalizations, realize associations, and preparing for testing. Steps one and two are driven by the theory of transformations. Transformations “is a mapping from the domain of models to the range of models”(Blaha & Rambaugh, 2005) The first step in implementation modeling is fine-tuning classes. It is best to fine-tune classes before writing code because it will help to simplify development or to improve performance. If for some reason you have to alter the design first consider the following possibilities; partition a class, merge classes, partition or merge attributes, or promote an attribute or demote a class. The next step in implementation modeling is fine-tuning generalizations. It is helpful to remove generalization or to add one prior to coding. The third step is realizing associations. This is what holds the class model together by providing paths between objects. The final step is testing. “Testing is a quality assurance mechanism for catching residual errors.” (Blaha & Rambaugh, 2005) It also measures the quality of your software. “Implementation is the final development stage that addresses the...

Words: 319 - Pages: 2

Premium Essay

Introduction to Object-Oriented Programming

...of input and output are allowed or expected. Inputs are usually specified syntactically in the form of arguments and the outputs delivered as return values. To be considered a procedural, a programming language should support procedural programming by having an explicit concept of a procedure and syntax to define it. It should ideally support specification of argument types, local variables, recursive procedure calls and use of procedures in separately built program constructs. It may also support distinction of input and output arguments. C, ALGOL are the classic examples of procedural programming language. Characteristics of Procedure-oriented Programming: 1.   Top-down approach is followed. 2.   Data is given less importance than function. 3.   Vulnerability of data is there, as functions share global data. 4.   Functions manipulate global data, without letting other functions to know. 5.   Big program is divided into small modules. 6.   Algorithms are designed first without bothering about minute details. ------------------------------------------------- 1.3 PROGRAMMING METHODOLOGY Bottom-up and Top-down Approaches Any problem can be dealt with two ways, namely top-down or bottom-up. A simple example is given in Figure 1.4 to illustrate the concept. Sorting an array of numbers involves the following: 1.   Comparison 2.   Exchange In top-down approach, at the top level, an algorithm has to be formulated to carry out sorting using the above operations. Once the algorithm is......

Words: 2729 - Pages: 11

Premium Essay

Object Oriented

...Benchmarking Survey Results  What are the primary purposes for the Chemical Management System? 7 Chemical Inventory Management Benchmarking Survey Results  Barcoding Processes  Every site barcodes individual containers, but not every site barcodes all their individual containers  Bulk tanks—7 of the 9 sites use a barcode for their tanks  3 of the 8 sites barcode process tanks  10 of 11 sites barcode gas cylinders  5 of 8 sites barcode case lots (one barcode on the case)  Static Inventory-where one barcode may be used for a predetermined inventory quantity. 3 of the 8 sites have this. 8 Chemical Inventory Management Benchmarking Survey Results  Level of Tracking   There was a lot of variation Tracking can be done to a group of buildings, to the building level, a fire zone within a building, to the room level, or to a sublocation within a room (shelf) 9 Chemical Inventory Management Benchmarking Survey Results  More on Tracking…  11 of 12 respondents use “Full-Until-Empty” tracking  10 of 11 respondents track welding, soldering & brazing filler materials  3 sites track lead shielding (blocks, bricks, shot…)  5 sites track toxic machine stock  3 sites track metals such as stainless. One site indicated they track grinding wheels and similar objects  At all but 1 site, chemical ingredients are tracked 10 Chemical Inventory Management Benchmarking Survey Results  Inventory update frequency  Most sites responded “real......

Words: 1410 - Pages: 6

Free Essay

4 Pilars of Object Oriented Design

...University-Dasmariñas College of Engineering, Architecture and Technology Engineering Department- CPE FOUR PILARS OF OBJECT ORIENTED DESIGN HOMEWORK NO.3 Submitted By: Depone, Carmela R. CPE52 Submitted To: Mr. Dwight Sabio Instructor Date Submitted: August 4, 2014 ABSTRACTION A model of a complex system that includes only the details essential to perspective of the viewer of the system or Only the characteristics of the system that are essential to the problem being studied are modelled; minor or irrelevant details are ignored. Example and Explanation * An abstraction is a model of a complex system that includes only the essential details.  * Abstractions are the fundamental way that we manage complexity.  * Different viewers use different abstractions of a particular system. * Thus, while we see a car as a means of transportation, the automotive engineer may see it as a large mass with a small contact area between it and the road. What does abstraction have to do with software development? * The programs we write are abstractions.  * A spreadsheet program used by an accountant models the books used to record debits and credits.  * An educational computer game about wildlife models an ecosystem.  * Writing software is difficult because both the systems we model and the processes we use to develop the software are complex.  * One of our major goals is to convince you to use......

Words: 2333 - Pages: 10

Free Essay

Object Oriented Programming -Java

........................................................................................ 4 Provide the UML diagrams for the given problem with clear explanations on the design decisions. Derive detailed Use Case diagram, Class diagram & a sequence diagram. Whenever necessary document the relevant assumptions you made. ...................................................................................... 4 TASK B ....................................................................................................................................................... 7 Provide an alternative OO design for the same problem ......................................................................... 7 Object Oriented Known as Methodology or paradigm to design a program using classes and objects. It simplifies the software development and maintenance. ......................................................................... 7 TASK C ....................................................................................................................................................... 9 There are many system design patterns available in system development. Critically evaluate singleton, factory and abstract factory design patterns and apply the most suitable design pattern for your system development................................................................................................................................. 9 TASK D .................................................

Words: 4819 - Pages: 20

Premium Essay

Object Oriented Analysis and Design

...SOF535 Object oriented analysis and design ABSTRACT This is pages are for downloading of Visual studio and setting up IDE environment.First I have gone to the link and download the IDE from that link so process starts from here.It is the first page of Downloading process visual studioMicrosoft Visual Studio is an integrated development environment (IDE) from Microsoft. It is used to develop computer programs for Microsoft Windows, as well as web sites, web applications and web services. Visual Studio uses Microsoft software development platforms such as Windows API, Windows Forms, Windows Presentation Foundation, Windows Store and Microsoft Silverlight. It can produce both native code and managed code. Visual Studio includes a code editor supporting IntelliSense (the code completion component) as well as code refactoring. The integrated debugger works both as a source-level debugger and a machine-level debugger. Other built-in tools include a forms designer for building GUI applications, web designer, class designer, and database schema designer. It accepts plug-ins that enhance the functionality at almost every level—including adding support for source-control systems (like Subversion) and adding new toolsets like editors and visual designers for domain-specific languages or toolsets for other aspects of the software development lifecycle (like the Team Foundation Server client: Team Explorer). Visual Studio......

Words: 1330 - Pages: 6

Free Essay

Object Oriented Programming Definitions

...00054707 Encapsulation Encapsulation in Java is where data and variables are wrapped and grouped together by using methods. The variables of the class will be hidden initially and will only be displayed if the method of the same class is utilized Two things must be done to achieve encapsulation * Declare the variables of a class as private. * Provide public setter and getter methods to modify and view the variables Inheritance This is where a class that is derived from another class is called subclass and inherits all fields and methods of its superclass (the main class) Variables and methods can then be added to the subclass as fit. The inheritance is also one way meaning that the superclass cannot inherit from the subclass Class Sandwich { } Class sub Chicken extends Sandwich { } Polymorphism Polymorphism is the ability of an object to take on many forms. This can be where a child class is created and extends a parent class to inherit their common variables and add new variables to match the requirements Public interface Food {} Public class Burger {} Public class Bigmac extends Burger implements Food {} Class A class is a blue print from which individual objects are created and modified. There are three type of variables Local variables: Variables that are defined inside method Instance variables: Instance variables are variables within a class but outside any method Class variables: Class variables are variables declared......

Words: 601 - Pages: 3