Giter VIP home page Giter VIP logo

ooplab-s3's Introduction

OOPLab-S3

Questions

(A) Basic programs using datatype, operators, and control statements in Java.

  1. Write a Java program that checks whether a given string is a palindrome or not.
  2. Write a Java Program to find the frequency of a given character in a string. **
  3. Write a Java program to multiply two given matrices.

(B) Object-Oriented Programming Concepts: Problem on the use of constructors, inheritance, method overloading & overriding, polymorphism and garbage collection:

  1. Write a Java program which creates a class named 'Employee' having the following members: Name, Age, Phone number, Address, Salary. It also has a method named 'printSalary( )' which prints the salary of the Employee. Two classes 'Officer' and 'Manager' inherits the 'Employee' class. The 'Officer' and 'Manager' classes have data members 'specialization' and 'department' respectively. Now, assign name, age, phone number, address and salary to an officer and a manager by making an object of both of these classes and print the same. (Exercise to understand inheritance). **
  2. Write a java program to create an abstract class named Shape that contains an empty method named numberOfSides( ). Provide three classes named Rectangle, Triangle and Hexagon such that each one of the classes extends the class Shape. Each one of the classes contains only the method numberOfSides( ) that shows the number of sides in the given geometrical structures. (Exercise to understand polymorphism).
  3. Write a Java program to demonstrate the use of garbage collector.

(C) Exception Handling

  1. Write a java program to show exception handling in java.

(D) Package

  1. Write a Java program which contains three classes animalpackage.Animal, B and Main1. The class animalpackage.Animal is in package ‘packageone’ and contains a method ‘methodClassOne’ that prints a message stating that it is printed from class animalpackage.Animal. Similarly, class B is in package ‘packagetwo’ and contains a method ‘methodClassTwo’ that prints a message stating that it is printed from class B. The Main1 class imports these classes, creates their instances and invokes their corresponding methods.
  2. Consider a scenario where an interface named ‘animalpackage.Animal’ is in a package named ‘animalpackage’ and it declares two methods ‘get_cries’ and ‘get_eating_type’ that are placeholders for printing the cry and eating type of animals. The subpackages of ‘animalpackage’ are ‘herbivorous’ and ‘carnivorous’. The ‘herbivorous’ package contains two classes ‘Cow’ and ‘Elephant’ that implements the ‘animalpackage.Animal’ interface. Similarly, the ‘carnivorous’ package contains ‘Lion’ and ‘Bear’ that to implement the interface. Design a Main1 class that import these classes and invokes the corresponding methods.

(E) Handling different types Of files as well as input and output management methods:

  1. Write a file handling program in Java with reader/writer.
  2. Write a Java program that read from a file and write to file by handling all file related exceptions.
  3. Write a Java program that reads a line of integers, and then displays each integer, and the sum of all the integers (Use String Tokenizer class of java.util).

(F) Standard Searching and Sorting Algorithms using data structures and algorithms learned from course Data Structures (CST 201):

  1. Write a Java program for the following:
    1. Create a doubly linked list of elements.
    2. Delete a given element from the above list.
    3. Display the contents of the list after deletion.
  2. Write a Java program that implements Quick sort algorithm for sorting a list of names in ascending order.
  3. Write a Java program that implements the binary search algorithm.

ooplab-s3's People

Contributors

fbn776 avatar

Stargazers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.