...OBJECT ORIENTED PROGRAMMING IN JAVA ‐ EXERCISES CHAPTER 1 1. Write Text‐Based Application using Object‐Oriented Approach to display your name. // filename: Name.java // Class containing display() method, notice the class doesnt have a main() method public class Name { public void display() { System.out.println("Mohamed Faisal"); } } // filename: DisplayName.java // place in same folder as the Name.java file // Class containing the main() method public class DisplayName { public static void main(String[] args) { Name myname = new Name(); // creating a new object of Name class myname.display(); // executing the display() method in the Name class } } 2. Write a java Applet to display your age. // filename: DisplayNameApplet.java import java.applet.Applet; // import necessary libraries for an applet import java.awt.Graphics; public class DisplayNameApplet extends Applet { public void paint(Graphics g) { g.drawString("Mohamed Faisal", 50, 25); } } // filename: DisplayNameApplet.htm // place in same folder as the compiled DisplayNameApplet.class file Displaying my Name CHAPTER 2 3. Write a program that calculates and prints the product of three integers. // filename: Q1.java import java.util.Scanner; // import Scanner libraries for input public class Q1 { public static void main(String[] args) { Scanner input = new Scanner (System.in); int number1; int number2; int number3; System.out.println("Enter the First Number"); www.oumstudents...
Words: 3130 - Pages: 13
...ORGANIZATION OF PROGRAMMING LANGUAGES | | ANZOTSA JOHN ALAKU | BHU/12/04/05/0042 COMPUTER SCIENCE 400 LEVEL | | | ABRSTRACT My objective for these research was to find out about different programming languages and paradigm in which they belong, the most important use in this research are text and journal by other researchers. After all studies where carried out, I came to a conclusion that one programing language can belong to more than one paradigm C++ C++ is a statically typed, free-form, multi-paradigm, compiled, general-purpose programming language. Some people say that C++ is a middle language because it has the features of high level and low-level language. As one of the most popular programming languages in the world, C++ is widely used in the software industry. C++ is also used for hardware design to analyze structure. Some of its application domains include systems software, application software, device drivers, embedded software, high-performance server and client applications, and entertainment software such as video games. AspectJ AspectJ is a general-purpose Aspect-Oriented extension to java programming language. It was created at Palo Alto Research Center Incorporated (PARC), now it is an open source project and part of the Eclipse Foundation. AspectJ has everything that Java has and more which means every valid Java program...
Words: 3773 - Pages: 16
...Pasig campus pangilinan DSITI-AI Oct 27 15 Java Programming java programming Introduction in java programming Objectives * Object-Oriented Programming Language * Object-Oriented Programming Principle * Benefits Of Object-Oriented Programming * Introduction To Java Programming * Resources Used To Create a Java Programming *Structures Of a Java Programming * Result Of Executing The Java Programing Object Oriented Programming Language (OOPL) OOPL Is An Extension Of Procedural Language. Involves Creating Program Components as Object Related To The Real Word. Writing Object-Oriented Programs Involves Creating Object And Application That Uses Those Objects. An Object Contains Both Data Procedures Can be packaged Into a Single Unit. Based On Three Concepts Encapsulation Ability To Bind Data And Procedures Into an Object. Inheritance Ability Of Objects To Acquire The Attributes Or Behavior Of Other Objects Or Classes. Polymorphism Ability of An Object To Take Many Forms Or Identities. Benefits Of Object-Oriented Programming *Reusability -Able To Reuse The Defined Objects. *Adaptability –Able to fit in different environment. *maintainability –Able to change easily. *reliability –Able to operate...
Words: 1445 - Pages: 6
...1970’s CLU is a programming language created at MIT by Barbara Liskov and her students between 1974 and 1975. It was notable for its use of constructors for abstract data types that included the code that operated on them, a key step in the direction of object-oriented programming (OOP). Euclid is an imperative programming language for writing verifiable programs. It was designed by Butler Lampson and associates at the Xerox PARC lab in the mid-1970s. The implementation was led by Ric Holt at the University of Toronto and James Cordy was the principal programmer for the first implementation of the compiler. It was originally designed for the Motorola 6809 microprocessor. Forth is an imperative stack-based computer programming language and programming environment. Language features include structured programming, reflection (the ability to modify the program structure during program execution), concatenative programming (functions are composed with juxtaposition) and extensibility (the programmer can create new commands). Although not an acronym, the language's name is sometimes spelled with all capital letters as FORTH, following the customary usage during its earlier years. Forth was designed by Charles H. Moore and appeared in the 1970’s. GRASS is the original version of GRASS was developed by Tom DeFanti for his 1974 Ohio State University Ph.D. thesis. It was developed on a PDP-11/45 driving a Vector General 3DR display, and as the name implies, this was a purely vector...
Words: 1885 - Pages: 8
...FACULTY OF MATHEMATICS AND NATURAL SCIENCE. 4. PROPOSED DEGREE: M. Sc. (INFORMATIC SCIENCE) 5. TITLE: Object-Oriented Systems Analysis and Design: a case of District Health Information System, Mozambique. TABLE OF CONTENTS ABSTRACT i INTRODUCTION 1 RELEVANT FINDINGS (LITERATURE REVIEW) 2 OBJECT-ORIENTED SYSTEMS ANALYSIS AND DESIGN 2 THE RESEARCH PROBLEM AND WHY THIS PROBLEM AREA 5 THE RESEARCH QUESTIONS 5 RESEARCH OBJECTIVES 6 TARGET GROUP 7 PERSONAL MOTIVATION 7 METHODOLOGY 7 BIBLIOGRAPHY: 13 ABSTRACT Many organisations are relying on software systems. Thus these organisations spend a lot of money on software systems and, to get a return on that investment, the software must be usable for a number of years. For many organisations, introducing new software implementation from scratch is a risk. This is because their requirements are not well defined or they don’t have enough expertise to understand and identifies software that can fit their problems. So, many organisations adopt software. That means they take analogy software (software developed for another organisation with the some similarities) and adopt it to fit their needs. In my research, I want to address the problems of adopting systems developed in the functional-oriented methodology and propose object-oriented systems analysis and design methodology. Mainly I would like to assess the flexibility of the structure of software and...
Words: 3840 - Pages: 16
...1970’s: Smalltalk is an object-oriented, dynamically typed, reflective programming language. Smalltalk was created as the language to underpin the "new world" of computing exemplified by "human–computer symbiosis."[1] It was designed and created in part for educational use, more so for constructionist learning, at the Learning Research Group (LRG) of Xerox PARC by Alan Kay, Dan Ingalls, Adele Goldberg, Ted Kaehler, Scott Wallace, and others during the 1970s. The language was first generally released as Smalltalk-80. Smalltalk-like languages are in continuing active development, and have gathered loyal communities of users around them. ANSI Smalltalk was ratified in 1998 and represents the standard version of Smalltalk. Compiler Description Language, or CDL, is a programming language based on affix grammars. It was designed for the development of compilers. It is very limited in its capabilities and control flow; and intentionally so. The benefits of these limitations are twofold. On the one hand they make possible the sophisticated data and control flow analysis used by the CDL2 optimizers resulting in extremely efficient code. The other benefit is that they foster a highly verbose naming convention. This in turn leads to programs that are to a great extent self-documenting. The original version, designed by Cornelis H. A. Koster at the University of Nijmegen emerged in 1971. Pascal is a historically influential imperative and procedural programming language, designed in...
Words: 2326 - Pages: 10
...1.1 Introduction Object-Oriented Strategies Object-oriented programming embodies in software structures a number of powerful design strategies that are based on practical and proven software engineering techniques. By incorporating support for these strategies in software structures, object-oriented programming enables the manageable construction of more complex systems of software than was previously possible. The nature of these software structures has been shaped by decades of software engineering experience. The basic design strategies that are embodied in object-oriented programming are presented in the Table 1.1. The design strategies evolved as techniques for dealing with complex natural and man-made system. Because these strategies are so fundamental, they are encountered in other contexts and in other programming language forms. What is stressed here is the relationship of these strategies to the design and construction of object-oriented software. These strategies are widely supported by existing object-oriented languages though different languages may present them in different ways and some languages may support other variations of each one. For example, some object-oriented languages have additional ways of supporting generalization. The design strategies in object-oriented programming are effective for constructing software models of entities in the problem domain. In fact, some have argued that software design is largely about constructing a software model of the...
Words: 16718 - Pages: 67
...but for teaching computer science. It is best described as a simplified version of Algol. It was simplified both to make it easier to learn and to make it easier to compile (i-programmer.info, 2010). C- Was created by Ken Thompson iin the form of B and tweaked by Dennis Ritchie and renamed C in the 1970’s. It was the original code Unix was written in. Its function was for ease of use (i-programmer.info, 2010). Forth- was created by Charles H Moore in the 1970’s. The motivation behind this language was for both interactive execution of commands and the ability to compile sequences of commands for later execution (i-programmer.info, 2010). PLEX (Programming Language for EXchanges)- was created by Goran Hemdahl at Ericsson in the 1970’s. It is a special-purpose, pseudo-parallel and event-driven real-time programming language dedicated for AXE telephone exchanges, It is a propriatary language (i-programmer.info, 2010). 1980’s Atari ST BASIC – Atari commissioned MetaComCo to write a version of BASIC that would take advantage of the GEM environment on the Atari ST. This was based on a version already written for Digital Research called DR-Basic, which was bundled with DR's CP/M-86 operating system. The result was called ST BASIC. At the time the ST was launched, ST BASIC was bundled with all new STs. A further port of the same Basic called ABasiC ended up being supplied for a time with the...
Words: 1761 - Pages: 8
...Object-Oriented Analysis and Design Method MAO BO 2015 SPRING Course Category and Objects • Category • Core course for undergraduate students in major of Information Management and Information Systems • Objects • Understanding the elementary programming with Java(?) • Understanding methodologies and technologies of object-oriented analysis and design • Be more prepared for future software-related jobs MAO Bo, School of Economics and Management, Tsinghua University Spring, 2015 2 You will learn about • How to programming with Java • How to gather software requirements • How to analysis software using object-oriented theory • How to design software using object-oriented theory • How to communicate the software analysis and design using UML (unified modeling language) diagrams • How to divide a software project into phases with objectoriented thinking MAO Bo, School of Economics and Management, Tsinghua University Spring, 2015 3 Contents of Course in Java 1. 2. 3. 4. 5. 6. Elementary Programming with Java Selections and Loops Method and Arrays in Java Objects and Classes Inheritance and Polymorphism Event-Driven Programming and Exception Handling MAO Bo, School of Economics and Management, Tsinghua University Spring, 2015 4 Contents of Course in OOA&D 7. What is great software and how can get it? 8. How to gather software requirement? 9. How to deal with software requirements change? 10. Object-oriented software analysis approaches 11. Object-oriented software...
Words: 385 - Pages: 2
...Matthew Robert English 103 13 April 2013 Java the Programming Language Computer is very important in our live, we use computer in everywhere on our live. The doctor uses the computer to see file or pictures of his patients. Also, each engineer uses it in many ways of his work. The teacher in the classroom, employees in the offices and student in their study all of them use computer in them daily live. They are not using the mouse, the keyboard or the scream. They are using the applications by them these applications in the computer are like the soul in the body. The only way to build these applications is programming. To program we need to know one of the programming languages which are very similar each other. If you are professional in one of these languages you can be professional in the other language in a short period of time. It is acceptable if you have the same application written with Java once and with C++ or C sharp at the same time. So for this reason you cannot say that a programming language is better than others. There are three types of programming languages procedural, functional and object-oriented languages. The most uses of these languages are object-oriented and one of these languages is Java you can write any application you need using it. Also you can translate any application to its word. The message of the High-Level programming languages such as Algol and Pascal in first programming revolution was Control abstraction. In the...
Words: 2352 - Pages: 10
...Meet Karel the Robot Wednesday 25 Programming with Karel Control structures in Karel 27 Friday Problem-solving in Karel Program decomposition The idea of an algorithm 30 Read: Karel, Chapters 1-3 Read: Karel, Chapters 4-6 October 2 4 Control statements Boolean expressions Introduction to Java Variables, values, and types Classes and objects Arithmetic expressions The Program class hierarchy Read: Java, Chapters 1-2 7 Methods Using parameters Read: Chapter 3 9 More parameters Pseudorandom numbers The RandomGenerator class Read: Chapter 4 Due: Assignment #1 11 Creating classes Stylistic expectations Using javadoc Read: Chapter 5 14 Read: Chapter 6 16 18 Character data The Java String class The acm.graphics package More graphics The collage graphics model Event driven programming Read: Chapter 9.1-9.3 Due: Assignment #2 21 Read: Chapter 9.4 Read: Chapter 10.1–10.4 23 Read: Chapter 8.1-8.4 25 File processing Exception handling String manipulation Objects and memory Problem-solving with strings More on parameter passing Read: Chapter 8.5 Read: Chapter 7 Due: Assignment #3 Read: Chapter 12.4 –2– Monday 28 Arrays and ArrayList 30 Arrays and ArrayList (continued) Wednesday Friday November 1 Belated midterm recovery day (No class) Read: Chapter 11.1-11.8 Tuesday, October 29th 7:00-9:00pm: Midterm 4 6 Debugging strategies Java collections framework The HashMap class Iterators Object-oriented design Read: Chapter 13 13 Component...
Words: 409 - Pages: 2
...FORTRAN - added structured statements borrowed from Algol to produce Fortran 77. COBOL- more static and only submitted to slight revision in 74. 1980's C++ - a general purpose programming language. It has imperative, object-oriented and generic programming features, while also providing the facilities for low level memory manipulation. Perl - a family of high-level, general-purpose, interpreted, dynamic programming languages. The languages in this family include Perl 5 and Perl 6. Ada - originally designed by a team led by Jean Ichbiah of CII Honeywell Bull under contract to the United States Department of Defense (DoD) from 1977 to 1983 to supersede the hundreds of programming languages then used by the DoD. Objective-C - a general-purpose, object-oriented programming language originally developed in the early 1980s. It is the main programming language used by Apple. Caml ( Categorical Abstract Machine Language) is a dialect of the ML programming language family. 1990's Python - started in December 1989[26] by Guido van Rossum at CWI in the Netherlands as a successor to the ABC language Visual Basic - a third-generation event-driven programming language and integrated development environment (IDE) from Microsoft for its COM programming model first released in 1991. Java - a computer programming language that is concurrent,...
Words: 561 - Pages: 3
...1 Learn Java/J2EE core concepts and key areas With Java/J2EE Job Interview Companion By K.Arulkumaran & A.Sivayini Technical Reviewers Craig Malone Stuart Watson Arulazi Dhesiaseelan Lara D’Albreo Cover Design, Layout, & Editing A.Sivayini Acknowledgements A. Sivayini Mr. & Mrs. R. Kumaraswamipillai 2 Java/J2EE Job Interview Companion Copy Right 2005-2007 ISBN 978-1-4116-6824-9 The author has made every effort in the preparation of this book to ensure the accuracy of the information. However, information in this book is sold without warranty either expressed or implied. The author will not be held liable for any damages caused or alleged to be caused either directly or indirectly by this book. Please e-mail feedback & corrections (technical, grammatical and/or spelling) to java-interview@hotmail.com First Edition (220+ Q&A): Dec 2005 Second Edition (400+ Q&A): March 2007 3 Outline SECTION DESCRIPTION What this book will do for you? Motivation for this book Key Areas index SECTION 1 Interview questions and answers on: Java Fundamentals Swing Applet Performance and Memory issues Personal and Behavioral/Situational Behaving right in an interview Key Points SECTION 2 Interview questions and answers on: Enterprise Java J2EE Overview Servlet JSP JDBC / JTA JNDI / LDAP RMI EJB JMS XML SQL, Database, and O/R mapping RUP & UML Struts Web and Application servers. Best practices and performance considerations. Testing and deployment. Personal and...
Words: 23255 - Pages: 94
...Programming Languages Throughout the decades 1970’s C – It was developed by Dennis Ritchie between 1969 and 1973 at AT&T Bell labs. The development of this language is closely tied to the development of Unix, which was originally implemented by Ritchie and Ken Thompson in assembly language on PDP-7. They decided to port the operating system to a PDP-11. They considered rewriting the operating system using B language. However, B’s inability to take advantage of some of the PDP-11’s features led to the development of C. Pascal – Published in 1970 and designed by Niklaus Wirth, it was intended as a tool to teach structured programming. Smalltalk – Smalltalk was the product of research led by Alan Kay and implemented by Dan Ingalls. Ingalls created the first version in a few mornings when he was bet that a programming language based on message passing inspired by Simula could be implemented in a page of code. Prolog – A general purpose logic programming language designed by Alain Colmerauer and published in 1972. SQL – A special purpose programming language designed for managing data held in a relational database management system. It was designed by Donald D. Chamberlin and Raymond F. Boyce in 1974. One of the first and most widely used commercial languages for Edgar F. Codd’s relational model. 1980’s C++ - An intermediate general purpose language, designed by Bjarne Stroustrup in 1983. It was Stroustup’s idea to enhance C language with Simula-like features...
Words: 804 - Pages: 4
...examples in more recent years. This is not to say that more recent additions are necessarily better, just more specialized and optimized for particular functions and environments. A few notable examples include Pascal, C#, Java, Ruby, and Visual Basic. Pascal is an interpretive language published in 1970 by swiss programmer Niklaus Wirth. It is named for French mathematician Blaise Pascal, and was intended to be a compact, efficient language. Pascal’s structure is designed to encourage good programing practices and be easy to learn. C# or C sharp is a simple, modern, general-purpose, object-oriented programming language that is intended to run in Microsoft’s .Net framework. It was first published around 2000, with its latest update C# 6.0, having been released on 6/20/2015. One of the goals of C# is to be easy to learn to those already familiar with C and C++. Java was developed by Sun Microsystems and published by the Oracle Corporation. It first appeared in 1995, and its most recent stable release was 10/15/2015. It is intended to be executable on any compatible device without needing to be recompiled, and is very widely used. Much of java is derived from C and C++, however it has fewer lower level facilities than either. Ruby is a dynamic, reflective, object orientated programing language developed in the mid to late 1990’s by Yukihiro Matsumoto. It is used mostly for programs that run on web servers, and its last stable release, 2.2.3 was released on 08/18/2015. It is intended...
Words: 494 - Pages: 2