Uka Tarsadia University (Diwaliba Polytechnic)
Diploma in Computer Engineering
Assignment(Java Programming-020040403)
Assignment 1
1. Write a program in Java to find maximum of three numbers using conditional
operator.
2. Write a program in Java to reverse the digits of a number using while loop.
3. Write a Java program to print digits of a given number using while loop.
4. Write a Java program to print first 100 odd numbers using while loop.
5. Write a Java program to implement calculator using switch statement.
6. Write a Java program which prints all numbers between given range using do-while
loop.
7. Write a Java program to print all odd numbers between N1 to N2. N1 and N2 are user
input.
8. Write a Java program to print 1 to N numbers in reverse order, where N is the user
input.
9. Write a Java program to sum two numbers using command line arguments.
10. Write a Java program to print sum of 1 to N numbers, where N is user input.
11. Write a Java program to change case of entered string.
12. Write a java program to perform addition of two number, three number and four
number using concept of method overloading.
13. Write a java program to demonstrate the use of final keyword.
14. Write a java program to demonstrate the use of this keyword.
15. Write a java program that implements constructor overloading.
16. Write a java program that implements copy constructor.
17. Write a java program that implements Box object and calculate the volume of Box
using class method.
18. Write a java program that implements Box object and assign value to its attribute by
passing argument to the class method and calculate the volume of Box.
19. Write a java program the implements rectangle object and initialize it using default
constructor.
20. Write a java program to calculate area of circle using constructor.
21. Create class Bank with the member variable acc_num and amount. It has the method
deposite() to credit the amount and withdraw() to debit the amount from the account.
22. Create class Train_details which has the members train_id, arrival_time,
departure_time and method put_detail() to print the data on console. Use
parameterized constructor to initialize the variables.
23. Create abstract class college with the data members university, city. It has method
display() and abstract method subject_list(). Create subclass IT_department which
implements the method subject_list().
24. Create class biodata having fields name, qualification and date_of_birth. Class biodata
inherits the class address having fields city and pin. Write a Java program to display
details for two persons.