You are on page 1of 2

VIT

UNIVERSITY
(Estd. u/s 3 of UGC Act 1956)

Course Semester Lab

Vellore - 632 014, Tamil Nadu, India School of Information Technology and Engineering : B.Tech IT : III : Java Programming

CYCLE SHEET I 1) Write a java program called WhileTimes that uses for loops to print 10 times tables. 1 2 3 4 5 6 7 8 9 10 2 4 6 8 10 12 14 16 18 20 3 6 9 12 15 18 21 24 27 30 . . 10 20 30 40 50 60 70 80 90 100 2) Write a java program StringRep that displays the string representation of a 4 digit number.4380 four thousand three hundred and eighty. 3) Write a java Program that inputs a long number, separates the long into its individual digits and prints the digits separated from one another by a three spaces. Eg 456 7 8 is displayed as 4 5 6 7 8 4) Write a Java program to search and element in an integer array. The array should not be further searched if the search element is found. The Array is initialized in the program and the search element is obtained from command line. 5) Write a java program called Sort that includes two function displayArray that displays the double array and sortArray that sorts the double array.The functions are called in main. The array is created in main and assigned the valued obtained from command line.

6) Write a recursive function recursiveMin that takes an integer array, a starting subscript and an ending subscript as arguments, and returns the smallest element in the array . The function should stop processing and return when starting subscript equals ending subscript. 7) Create a class ComplexArithmetic perform Complex number arithmetic operations.The Complex object should be created in main function that is enclosed within a class ComplexMain.The complex arithmetic operations should be executed in an menu driven way( Use switch case ) 8) Create a class HugeInteger that uses a 40-element array of digits to store integers as large as 40 digits each. Provide member functions input, output, add and subtract.Forcomparing HugeInteger objects ,provide functions isEqualTo,isLessThan,isGreaterThan,isNotEqual-each of this is a predicate function that simply return true if relationship holds between two HugeIntegers and returns false otherwise.create objects of class in main function defined in class HugeIntegerMain to do all the operations.

9) Create a class Student containing stud_id, name, age, address as members. Write separate functions to read details about n students, display details about all students, display average age of all students, display details of students who are from the same location. 10) Write a program to extract a portion of a character string and to print the extracted portion and the remaining portion of the string. Assume that m characters are extracted, starting with the nth character.

11) Write a Java program to check if one string is an anagram of another.

12) Create a class Employee (Identity number, name, department code, address, designation, Salary, DOJ, DOB) and perform the following operations for 5 employees (Use array of objects) a. Reading the details from keyboard. b. Displaying the full details of a particular employee. c. Displaying the detail of senior most employee.

You might also like