Preview

Lab Exercises: Object Oriented Programming with Java

Good Essays
Open Document
Open Document
2916 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Lab Exercises: Object Oriented Programming with Java
Lab Exercises

Object Oriented Programming with Java

Lab Exercise
Lab Unit – 1 (2 Hrs Real Time)
1.1 Write a program to display any message:
1.2 Write a Java program to display default value of all primitive data types of
Java.
1.3 Write a program check two strings are equal or not.
Lab Unit – 2 (2 Hrs Real Time)
2.1 Write a program to give the examples of operators.
2.1.1 Increment and decrement operators.
2.1.2 Bitwise Complement Operator.
2.1.3 Arithmetic operator.
2.1.4 Relational Operator
2.1.5 Bitwise operator.
2.1.6 Conditional Operator.
2.2 Write a program to give the example of control statements.
2.2.1 If statements.
2.2.2 Switch Statements.
2.2.3 For loop.
2.2.4 While Statements.
2.2.5 Do statements
2.3 Write a program to calculate the following
2.3.1 Find the length of array.
2.3.2 Demonstrate a one-dimensional array.
2.3.3 Demonstrate a two-dimensional array.
2.3.4 Demonstrate a multi-dimensional array.
2.4 Write a program give example for command line arguments.

Centre for Information Technology and Engineering, Manonmaniam Sundaranar University

1

Object Oriented Programming with Java

2.4.1
To find the sum of command line arguments and count the invalid integers entered.
2.4.2
To get the name using command line.
2.5 Write a program to print the following triangle of binary digits.
2.5.1

1
101
10001
1000001
100000001

2.5.3

2.5.2

5
45
345
2345
12345
012345

1
12
123
1234
12345

2.6. Write a program to the find the following
2.6.1 Prime number checking
2.6.2 Sum of digit
2.7 Write a program to arrange the numbers in ascending order.
2.8 Write a program to calculate the roots of Quadratic equations.
2.9 Write a program for calculating Matrix Operations.
2.9.1 Addition.
2.9.2 Multiplication.
Lab Unit – 3 (2 Hrs Real Time)
3.1 Write a program to create a room class, the attributes of this class is roomno, roomtype, roomarea and ACmachine. In this class the member

You May Also Find These Documents Helpful

  • Powerful Essays

    The purpose of this Lab. is to familiarize student how to solve practical problems programmatically; they will practice on elementary programming using primitive data types, variables, constants, operators, expressions, and input and output. Also, they will learn how to diagnose errors that may occur when a program is compiled or executed. There are some exercises, through which they will understand the concept learn in this chapter.…

    • 2338 Words
    • 10 Pages
    Powerful Essays
  • Satisfactory Essays

    Structured Query Language (SQL) is a standard database computer language used for querying, modifying and managing data in Relational Database Management Systems (RDBMS). SQL was developed in the 1970's by IBM to initially manipulate and retrieve data in IBM System R. The SQL language was standardized in 1986 by the American National Standards Institute (ANSI); however, later releases were released as International Organization for Standardization (ISO) standards.…

    • 612 Words
    • 3 Pages
    Satisfactory Essays
  • Powerful Essays

    Java Chapter 2 Quiz

    • 2047 Words
    • 9 Pages

    4. The ____ is normally considered the standard output and standard input devices, and usually refer to…

    • 2047 Words
    • 9 Pages
    Powerful Essays
  • Powerful Essays

    Java exam 1 practice test

    • 6434 Words
    • 53 Pages

    A set of instructions that enable the computer to solve a problem or perform a task…

    • 6434 Words
    • 53 Pages
    Powerful Essays
  • Good Essays

    “New York Freelance Technology is a web based organization affiliated with Montana Freelance Technology and GMR Web Services that continues to give you quality hosting at an affordable cost.” (New York Freelance Technology, 2011) Not only does NY Freetech perform web specific tasks, they also handle numerous person to person tasks such as custom computer building, videography and DVD authoring. Their web related tasks include web design, web development, graphics design, web hosting and DNS (domain name system). One thing NY Freetech does not have is a support forum for their customers. To contact customer service, currently you have to email them and wait for a reply. What is needed is a support forum. Customers or prospect customers can post in the forums and ask questions and the administrators can answer the questions. If other customers or users know the answer to the question, they can also answer. That will help the customers questions get answered faster. Upon reviewing the company website, I noticed there was no support forum. There is a small FAQ (frequently asked questions) but no forum. The personnel involved in the project have a certain role they must play, the steps of the program development cycle must be followed and the project should be performed in a modular fashion. For every task performed in any organization, personnel involved have roles they must play.…

    • 930 Words
    • 4 Pages
    Good Essays
  • Powerful Essays

    |1.2 Demonstrate an understanding of the |Code listings show a variety of objects | |…

    • 2281 Words
    • 10 Pages
    Powerful Essays
  • Satisfactory Essays

    concepts of classes, objects, constructors, methods, access control, this keyword, overloading methods and constructors, parameter…

    • 414 Words
    • 2 Pages
    Satisfactory Essays
  • Better Essays

    ii. The optional keyword static is used to declare a special kind of method called a class method. (Actually, all the methods I’ve asked you to write so far in this…

    • 939 Words
    • 4 Pages
    Better Essays
  • Good Essays

    1.) There have been several versions of SQL created in the last 26 years. In 1986, SQL-86 (SQL-87) was first published. In 1989, SQL-89 was a minor revision made to the original SQL. In 1992, SQL-92 (SQL2) was a major revision to its previous version. In 1999, SQL-99 (SQL3) added regular expression matching, recursive queries, triggers, non scalar types and some object oriented features. In 2003, SQL-2003 introduced XML related features, standardized sequences, and columns with auto generated values. In 2006, SQL-2006 defined ways in which SQL can be used in conjunction with XML and it defined ways of importing and storing XML data in an SQL database, manipulating it within the database and publishing both XML and conventional SQL-data in XML form. It also enables applications to integrate into their SQL code the use of XQuery. In 2008, SQL-2008 Legalized ORDER BY outside cursor definitions, added INSTEAD OF triggers, and added the TRUNCATE statement. As of March 2012, the newest SQL was released its new features include AlwaysOn SQL Server Failover Cluster Instances and Availability Groups which provides a set of options to improve database availability, Contained Databases which simplify the moving of databases between instances, new and modified Dynamic Management Views and Functions, programmability enhancements including new Spatial features, Metadata discovery, Sequence objects and the THROW statement, performance enhancements such as ColumnStore Indexes as well as improvements to OnLine and Partition level operations and security enhancements including Provisioning During Setup, new permissions, improved role management and default schema assignment for groups…

    • 701 Words
    • 3 Pages
    Good Essays
  • Satisfactory Essays

    The expression 1 To 5 in the Case 1 To 5 clause specifies the range of numbers from ____.…

    • 595 Words
    • 3 Pages
    Satisfactory Essays
  • Better Essays

    E-Commerce Exercise

    • 1068 Words
    • 5 Pages

    1. Create a program that prompts the user to enter two Strings. Then display the Strings in alphabetical order. If the two Strings are equal, display a message that they are equal rather than printing them in alphabetical order.…

    • 1068 Words
    • 5 Pages
    Better Essays
  • Better Essays

    Computer programs can help us solve everyday issues that might seem impossible. Household budgeting is an issue that burdens many Americans. Every individual is ultimately responsible for managing his or her finances. Developing a computer program that can help individuals manage their budget will greatly improve their life quality. The program would have to follow the program development cycle model and use the modular approach.…

    • 890 Words
    • 4 Pages
    Better Essays
  • Good Essays

    A.I observed the following things in the classroom. There is a rolling cart with a TV on it, in front of the classroom. There is an overhead projector sitting to the left of the teacher and a filing cabinet. There is a teacher’s podium to the right of a wipe off board that the students can see. There is another wipe off board on the right side of the classroom. There is a sorter on the teacher’s desk to help keep the students organized. The students desk are facing the front and to the side in the classroom. The desks are placed back from the front allowing room for moving around. In another room setting the desks are grouped together in groups of 4-6. The desks face each other allowing more room for the teacher to move around and work more with the students.…

    • 617 Words
    • 3 Pages
    Good Essays
  • Good Essays

    Pre School Observation

    • 545 Words
    • 3 Pages

    The class room is very clean and neatly organized. The class room is very colorful. There are many posters up on the walls. There are posters with pictures of animals, some with pictures of shapes and colors. . There is art work that the students had done hanging on the walls. Each student has his or her own cubby where they hang their coats, and it has a place at the bottom of it for them to place their lunch, if they brought one, and any library books they might have.…

    • 545 Words
    • 3 Pages
    Good Essays
  • Good Essays

    The Last Ride Together

    • 666 Words
    • 3 Pages

    Write a program which inputs Natural numbers N and M followed by integer arrays A[ ] and B[ ], each consisting of N and M numbers of elements respectively. Sort the arrays A[ ] and B[ ] in Ascending order of magnitude. Use the sorted arrays A[ ]…

    • 666 Words
    • 3 Pages
    Good Essays

Related Topics