The document outlines a practical assignment for an MCA Core Java class, which includes 30 programming problems divided into two parts - the first part covers basic Java programs, while the second part involves creating simple applications. Students are instructed to complete the assignment involving a variety of core Java concepts and submit it by a specified due date. The problems cover topics like arrays, strings, inheritance, abstraction and more.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
111 views6 pages
Assignment No-01 - Final
The document outlines a practical assignment for an MCA Core Java class, which includes 30 programming problems divided into two parts - the first part covers basic Java programs, while the second part involves creating simple applications. Students are instructed to complete the assignment involving a variety of core Java concepts and submit it by a specified due date. The problems cover topics like arrays, strings, inheritance, abstraction and more.
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: Write a Java program to read the lines from console until the given line is “good bye”. Display those lines which contain the word “India” or “Hello”. Also count the number of lines in which pattern is found. 22. Write a program: Write an application to define an interface ‘CalculateResult’ with methods CalculateTotal(), CalculatePercentage() and CalculateGrade(). Write student class with implementation of ‘CalculateResult’. Create student object and display total marks, percentage and grade of student. 23. Write a program: Define Class Employee. Define another two subclasses: (a) Temporary Employee Class (b) Permanent Employee Class i) Calculate salary for temporary employee depending upon no. of hours per month and overtime hours. ii) Calculate salary for permanent employee depending upon no. of days per month. iii) Override calcsal() method iv) Write appropriate constructors 24. Write a program:
25. Write a Program:
26. Write a Program:
27. Write a program:
28. Write a Program:
29. Write a short note on:
1. Method and Constructor Overloading in Java 2. Method and Constructor Overriding in Java 3. Static Keyword in Java 4. Final Class in Java 5. “this” and “final” Keyword in Java 30. Differentiate between: 1. Class and Interface 2. Interface and Package 3. Abstract Class and Interface