Smt. R.O.Patel
Women’s MCA College, Morbi
MCA 2012-13
Subject
Name: Programming Skills – IV (Java) - 630006
MCA
Semester: 3 Submission
Date: 21/July/2012
_____________________________________________________________________________________
Lab Manual 1
- Write a Java program which demonstrates “Hello world”.
-
Write a Java program which generate below given output.******************************
- Write a Java program to create and print Fibonacci series. (Fibonacci Series upto 20 element)
- Observe the interactions involved in the process of booking a railway ticket. Identify the various objects involved and the interactions between the objects in order to solve a problem of booking a railway ticket.
- Write a simple java application to print a pyramid with 5 lines. The first line has one character, 2nd line has two characters and so on. The character to be used in the pyramid is taken as a command line argument.
-
Write a Java application which takes several command line arguments, which are supposed to be names of students and prints output as given below:(Suppose we enter 3 names then output should be as follows)...Number of arguments = 31.: First Student Name is = Tom2.: Second Student Name is = Dick3.: Third Student Name is = Harry
- Write a class, with main method, which declares floating point variables and observe the output of dividing the floating point values by a 0, also observe the effect of assigning a high integer value (8 digits and above) to a float and casting it back to int and printing.
- Write a class called Statistics, which has a static method called average, which takes a one-dimensional array for double type, as parameter, and prints the average for the values in the array. Now write a class with the main method, which creates a two-dimensional array for the four weeks of a month, containing minimum temperatures for the days of the week(an array of 4 by 7), and uses the average method of the Statistics class to compute and print the average temperatures for the four weeks.
- Define a class called Product; each product has a name, a product code and manufacturer name. Define variables, methods and constructors, for the Product class. Write a class called TestProduct, with the main method to test the methods and constructors of the Product class.
- Define a class called CartesianPoint, which has two instance variables, x and y. Provide the methods getX() and getY() to return the values of the x and y values respectively, a method called move() which would take two integers as parameters and change the values of x and y respectively, a method called display() which would display the current values of x and y. Now overload the method move() to work with single parameter, which would set both x and y to the same values. Provide constructors with two parameters and overload to work with one parameter as well. Now define a class called TestCartesianPoint, with the main method to test the various methods in the CartesianPoint class.
No comments:
Post a Comment