collegeCurriculum

Sem 5

Java Programming using Linux Record programs

  1. Write a Java program to find the number of and sum of all integers greater than 100 and less than 200 that are divisible by 7

  2. Write a Java program to check whether a number is palindrome? Using Command Line arguments

  3. Write a Java program to perform Constructor Overloading

  4. Write a Java program to calculate the volume of different objects using method overloading

  5. Write a program to implement a class called Square with a method area(double a) that finds the area of the square. A class Cube which is a subclass of Square and an overriding method area(double a) that finds the surface area(6a^2) of a cube

  6. Write a program to implement a class with a method to find the area of a rectangle and a subclass to find the volume of a rectangular shaped box

  7. Program to implement an abstract class Perfect with abstract method void special(int n).A subclass of this class be Square and implement the special(int n) that finds the numbers that are perfect squares from 1 to n

  8. Write a Java program to implement dynamic method dispatch

  9. Create a class called Alpha with int x as instance variable, a constructor and a method alphaShow() to display x .Beta is a subclass of Alpha with with 2 intance variables float p and float q,a constructor and a method betaShow() to display p and q. (use superkeyword to invoke base class constructor)

  10. Program to implement an interface called Exam with a method pass(int mark) that returns a Boolean. Write another interface called Classify with a method Division(int average) which returns a string.Write a class called Result which implements both Exam and Classify.The pass() method should return true if the mark is greater than or equal to 50 else false.The Division() method must return “FIRST” when the parameter average is 60 or more, ”SECOND” when average is 50 or more but below 60, “NO DIVISION” when average is less than 50

  11. Create a class StringSort which contains a string array as data member.Include member functions to read an array of strings, to display the array and sort the array

  12. Write a complete java program to find whether the string “t” is contained in the given string.If so it returns the offset of first match. If not it returns -1

  13. Java program to print salary slip of n employees using user defined packages

    javac salarypack/Salary.java
    javac Employee.java
    java Employee
    
  14. Create a class Account with the data members account number, balance, name and any other required. Create a Menu driven application to perform the following

    i) Deposit
    ii) Withdraw
    iii) Display the details

    The program should work for n accounts

  15. Create a class Matrix which contains a two dimensional integer array m, n (order of matrix) as data members. Include the following member functions.

    i) to read the matrix
    ii) to display the matrix
    iii) to find the tranpose of the matix

  16. Program to create a package named shapes and define abstract class Shape inside it. The Shape class should have an abstract method getArea(). Define two subclasses Rectangle and Circle that extends the Shape class and implements the getArea() method. Create a class FindArea in a different package and use the Rectangle and Circle classes to find the areas of a reactangle and a circle

    javac shapes/Shape.java
    javac shapes/Rectangle.java
    javac shapes/Circle.java
    javac finalpack/FindArea.java
    
    java finalpack/FindArea
    
  17. Java program to illustrate Armstrong Exception

  18. Program to illustrate prime Exception

  19. Java application program to print odd and even numbers less than 10 using multithreading

  20. Write a java program that implements a multi-thread application that has three threads. First thread generates a random integer for every one second. second thread computes square of the number and prints; third thread gives the value of cube of the number

  21. Write multi threaded program to print lowercase letters and uppercase letters from two differentthreads with suitable delay

  22. Java program to perform insertion and retrieval operations using JDBC

  23. Java applet program to display the National Flag

  24. Java applet to display the Laughing face

  25. Java applet program to display the Olympic Ring

  26. Write an applet program to load an image and display it

  27. Write an applet program to show how to pass a parameter from an applet code and also illustrate the use of Font class

  28. Applet program to perform different Mouse events

  29. Applet program to illustrate different KeyEvents

  30. Java Program for an applet that accepts Roll number,Name, and Marks of 3 subjects of a student. Clicking on a button display the Total, Percentage and Grade of the student

  31. Program to accept an integer in a textbox, reverse it and find the sum of its digits. Display the result in different textboxes

  32. JFrame program to find the sum of 2 integers using JLabel, JTextField and JButton whenever necessary

Java Programming using Linux past lab exam qns and answers

Most of the past lab exam qns are similar to what we have here on our record. However, some of the past lab exam qns with answers that I’ve completed can be found here.