You are on page 1of 2

M. M.

INSTITUTE OF COMPUTER TECHNOLOGY & BUSINESS MANAGEMENT, MAHARISHI MARKANDESHWAR UNIVERSITY, MULLANA (AMBALA)
Class- MCA 4th Semester Subject Code: MCA-406 Session- 2011-12 Subject Title: S/W Lab - VII, JAVA (Based on MCA - 401)

LIST OF PRACTICAL ASSIGNMENTS IN JAVA


(Session: 2011-12)

[Command-Line-Arguments]
[1] Write a program to pass Starting and Ending limit and print all prime numbers and Fibonacci numbers between this range. Define a class to represent an Employee, include the following members: Data Members: y employee_code, emp_name, department, designation, basic_salary, hra, da, pf, tax, net_salary Member Functions y To get new employee information y To calculate HRA, DA, PF, TAX & net_salary y To display the information of employee. Write a main program to test the class Write a program to calculate Compound Interest using Wrapper Class Methods.

[Class & Objects]


[2]

[3]

[String, StringBuffer & StringTokenizer]


[4] [5] Write a program, which will read a string and rewrite it in the alphabetical order. For example, a word STRING should be written as GINRST. Write a program to parse a given string by using StringTokenizer class.

[Packages & Interfaces]


[6] Develop four utility methods like factorial( ), power( ), subString( ) and strReverse( ) and keep these methods in corresponding classes in two packages named myMath and myString and write a program to test these packages. Define a class to represent a Shape, with Data Members: first_value, second_value & Member Functions: getData( ) and putData( ) and also define an interface named Area with member function Calculate( ). Write a program to generate different classes to represent Square, Rectangle and Triangle using class Shape & interface Area and calculate area of different shapes.

[7]

[Multi-threading & Exception Handling]


[8] Write a program in Java, which will show lifecycle (creation, sleep, dead) of a thread. Program should print randomly the name of the thread and value of sleep

[9]

time. The name of the thread should be hard coded through constructor the sleep time of thread will be a random integer in the range 0 to 4999. Write a program that prompts the user to enter a number to use as an array size, and then attempt to declare an array using the entered size. If the array is created successfully, display an appropriate message. Java generates a NegativeArraySizeException if you attempt to create an array with a negative size, and a NumberFormatException if you attempt to create an array using a non-numeric value for the size. Use a catch block that executes if the array size is non-numeric or negative, displaying a message that indicates the array was not created. Write an applet code for bouncing a ball. Write a program to design an applet which receive Student Roll no., name and marks of three subjects through HTML page using PARAM tag and print the student name, roll no. and result on the web page using Java Applet. Write a program that display a movable yellow smiling face on the screen.

[Applet & Graphics]


[10] [11]

[12]

[File Handling]
[13] Write a program to copy the contents of one file (source) to another file (target). [14] Define a class named Telephone Directory with Data members: mobile_no, name of person Write an interactive, menu driven program that will access the file named Telephone.dat and implement the following tasks (using member functions): y To get the mobile no. and name of person. y Determine the mobile number of the specified person. y Determine the name if a mobile number is known y Update the mobile no., whenever there is a change

[Event Handling & Windows Programming]


[15] [16] Write a program to move the selected items from one ListBox to another using AWT package. Write a program to design a Calculator using Grid Layout with appropriate Event Handling Procedures.

[Network Programming]
[17] Design a User Datagram Protocol based Client-server application using DatagramSocket and Datagram Packet class. [18] Design a TCP based Client-Server application using Socket and ServerSocket class.

[Practical Assignments beyond Syllabus]


[19] [20] Write a program to design a Digital Clock in java. Write a program to select records from a database in java.

You might also like