0% found this document useful (0 votes)
87 views4 pages

Assignment No-01 - Final Java

The document outlines a practical assignment on core Java concepts for a university course. It includes 22 tasks divided into two parts: the first part covers basic Java programs, such as arithmetic calculations, array operations, and string/number conversions. The second part involves more complex applications using classes, objects, inheritance, and collections like arrays and lists. Students are instructed to complete the assignment within a week and submit their work by the specified due date.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
0% found this document useful (0 votes)
87 views4 pages

Assignment No-01 - Final Java

The document outlines a practical assignment on core Java concepts for a university course. It includes 22 tasks divided into two parts: the first part covers basic Java programs, such as arithmetic calculations, array operations, and string/number conversions. The second part involves more complex applications using classes, objects, inheritance, and collections like arrays and lists. Students are instructed to complete the assignment within a week and submit their work by the specified due date.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 4

MIT-WPU

Practical Assignment No: 01


Subject : Core Java

Assignment Date 2nd Sep 2022 Submission Date: 9th September 2022

===================================================================

Part – I (Basic Programs)


1. Write a Java program to print the sum, multiply, subtract, divide and remainder
of two numbers
2. Write a Java program that takes five numbers as input to calculate and print the
average of the numbers
3. Write a Java program to convert a decimal number to binary numbers
4. Write a Java program to convert a binary number to decimal number
5. Write a Java program and compute the sum of the digits of an integer
6. Write a Java program to compare two numbers
7. Write a Java program to count the letters, spaces, numbers, and other characters
of an input string
8. Write a Java program to print the even and odd numbers from 1 to 20 by using
call to two different methods belongs same super class
9. Write a Java program to compute the sum of the first 100 prime numbers
10. Write a Java program to swap the first and last elements of an array and create a
new array
11. Write a Java program to count the number of even and odd elements in a given
array
12. Write a Java program to check if a positive number is a palindrome or not
13. Write a Java program to add two numbers without using any arithmetic operators
14. Write a Java program to add all the digits of a given positive integer
15. Write a java program to Compute the Sum of the Principal and Secondary
Diagonals elements of a Matrix
Part – II (Simple Application Base Program)
==================================================
1. Write a Java Program to accept two numbers and a character(+,-,*,/) from the command
line argument and print the result according to character. (Use switch)
2. Accept a number from the command line argument and print the multiplication table of
it.
3. Write a Java Program to accept three numbers from the command line argument and print
the smallest number.
4. Accept a number from the command line argument and check whether it is prime or not.
5. Write a Java program which will accept a number from the command line argument and
check whether it is palindrome or not.
6. Define class Staff with data members as name, birth-date, designation and salary. Use
constructors and method display () –which will display details of Staff. Create two objects
of Staff and Print the name of staff having highest salary.
7. Define class Bank with data members as Cust_name, Ac_no and balance. Use
constructors and method withdraw and deposit. Print the balance according to operation.
8. Accept 5 numbers from command line argument and print it in the ascending order. (Use
array)
9. Write a Java program which will accept 3 X 4 matrix and print the row wise and column-
wise addition of numbers.
10. Write a java program to print multiplication of Matrix.
11. Create student class having data member (roll no, name, percentage) accept values and
display details (use command line argument).
12. Write a java program to create abstract class person derived two classes Employee and
Worker from it. Use proper method to accept and display for the same. Employee(eno,
ename, address), similar fields are worker.
13. Define class student with attribute rollno , name. Inherit student class in a class called
Marks, with attributes marks of Java Theory and Java Practical. Define method setMark()
in Mark class marks and set the total of Java marks in setmark() method, Show the Java
Marks in main class called FinalMarks.
(Take the Marks from system.)
14. Define a class employee having member variable – Emp_No, Emp_Name and
Designation. Define another class salary which, has been inherited from class employee,
having member variable Basic_Sal. Write appropriate method which will calculate
Basic_Sal. Depending on designation and constructor to initialize member variable.
15. Write a program to calculate Simple Interest To be Paid based on given schedule.

Principal Period of deposit Interest Rate


<= 10000 <= 2 years 9%
<= 10000 >= 2 years 10 %
> 10000 -- 11 %

16. Write a program:

17. Write a Program :

18. Write a program


19. Write a program:

20. Write a program:


Write a java program to accept n number of city. Insert into array list collection and
display the content of the same array list, remove all this element use (clear ()) method
21. Write a program:

22. Write a program:

You might also like