Practical Assignment - 2


Atmiya Institute of Technology & Science
Department of M.C.A.
M.C.A. Semester - III
630006 – Programming Skill - IV (JAVA)
Assignment – 2
Date :  28 / 08 / 2010
----------------------------------------------------------------------------------------------------------
1). 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 = 3
1: First Student Name is =Tom
2: Second Student Name is =Dick
3: Third Student Name is =Harry
(Hint: An array may be used for converting from numeric values from 1 to 20 into String.)

2). Create an array that stores 20 prices, such as $2.34, $7.89, $1.34, and so on. Display sum of All the prices. Display all values less than $5.Calculate the average of the prices and display all the values that are higher than calculated average value.

3). A set of 5 words is given. Write a program to reverse each word and arrange the resulting   words in alphabetical order.

4). A set of 10 names are given. Write a program to delete the first three characters of the names and arrange the resulting names in alphabetical order and print them out.

5). Find the minimum and maximum values in an array.

6). Demonstrate the use of stack class for characters. Hint(Use array of Characters)   
         
7). Write a Menu driven application in java for 2 dimension array.
          1). Matrix Addition
          2). Matrix Subtraction
          3). Matrix Multiplication
8). Develop same application as in exercise 7 using 3 Dimensional array.

9). Write a Menu driven application in java that demonstrate a use of Stack and Queue. (Hint : Use Different class for Stack and Queue)
1)     Stack
a.     Push
b.     Pop
c.      Display Stack
d.     Quit from stack
2)     Queue
a.     Insert
b.     Delete
c.      Display Queue
d.     Quit From Queue
3)     Exit

10). Write a class called Statistics, which has a static method called average, which takes a onedimensional 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.

1 comments:

Post a Comment