Sharp Tutorial
Assignments Program on Java

Python

Java

C

C++

HTML/CSS

Java Script

PHP

SQL

C Programs

Programming Assignments

  • Assignments Question on C Programming
  • Assignments Question on Java Programming
  • Assignments Question on Python Programming
  • Assignments Question on Java Script Programming

Click To read : Full Java tutorial in easy language with examples

Core Java Practical Assignments
Total -5 weeks

Week-1

Q.1 Write a Java program to find the factorial of a number.
Submit Answer
View Solution
Q.2 Write a java program which initialization earning of an employee. The program should 
calculate the income tax to be paid by the employee as per the criteria given below:
Slab rate              IT rate
Upto Rs. 50,000        Nil
Upto Rs. 60,000        10% on additional amount
Upto Rs. 1,50,000      20% on additional amount
Above Rs. 1,50,000     30% on additional amount
Hint: - Run: - java calculates 1,25,000
Result: - income tax is …………………………….
Submit Answer
View Solution
Q.3 Write a program to input n numbers on command line argument and calculate maximum of 
them.
Submit Answer
View Solution
Q.4 Write a program to print the sum and average of the even and odd numbers separately 
given on command line argument.
Submit Answer
View Solution
Q.5 Write a program to print the following pattern given n as argument:- [for input 3]

    1

    2          2

    3          3          3
Submit Answer
View Solution

Week-2

Q.1 Write a program to dynamically initialize memory for storing following values in the following 
    locations:-

    1          2          3          4

    2          4          6

    3          6

    4
Submit Answer
View Solution
Q.2 WAP to print all the prime numbers in an array of n elements by taking command line 
arguments.
Submit Answer
View Solution
Q.3 Design a class for a bank database the database should support the following operations.
    1. Deposit a certain amount into an account,
    2. Withdrawing a certain amount from an account,
    3. Return a value specifying the amount (i.e. balance) in an amount.
Submit Answer
View Solution
Q.4 Define a “Clock” class that does the following: -
    a. Accept hours, minutes and seconds.
    b. Check the validity numbers.
    c. Set the time to AM/PM mode.
  Use necessary constructors and methods to do the above task.
Submit Answer
View Solution
Q.5 Write a program to declare a stack and perform push and pop operation using stack class.
Submit Answer
View Solution

Week-3

Q.1 Write method of date class to support the following:-
    a.Method for validating that the integer-representing month is between 1 & 12 and checking 
that the day part of the date objects is within the correct range for a month. b.Obtaining the next day from a given date.
Submit Answer
View Solution
Q.2 Create a person inherit two classes from it politician & sportsman provide constructors & 
     calculate salary & display functions.
Submit Answer
View Solution
Q.3 Create a abstract class employee, having its properties & abstract function for calculating 
     net salary and displaying the information.  Drive manager & clerk class from this abstract 
class & implement the abstract method net salary and override the display method.
Submit Answer
View Solution
Q.4 Write a program that should print squares of natural numbers (1,2….10) the square should 
    not go beyond 100, & array size should not store more than 10 elements.  Generate exception
    if range overflow.
Submit Answer
Request Solution
Q.5 WAP to create your own exception as NegativeSizeException whenever negative values are 
put in an array.
Submit Answer
Request Solution

Week-4

Q.1 Write a program  to create two threads, one prints “HELLO” and other prints “HI”.
Submit Answer
Request Solution
Q.2 Write down a java program to print even and odd numbers series respectively from two 
threads: t1 and t2 synchronizing on a shared object Let t1 print message “ping — >” and t2 print message “,—-pong”. Take as command line arguments, the following inputs to the program: Sleep Interval for thread t1 Sleep Interval for thread t2 Message per cycle No of cycles
 
Submit Answer
Request Solution
Q.3 Using methods charAt() & length() of String class, write a program to print the frequency 
    of each character in a string.

    “Hello friend”

    Output should be
    -: 1
    d: 1
    e: 2
    f: 1
   (continued for all character in the string)
 
Submit Answer
Request Solution
Q.4 Write a program to count numbers of words in command line argument.
 
Submit Answer
Request Solution
Q.5 WAP in java to check the input characters for uppercase, lowercase, number of digits and 
    other characters.
Submit Answer
Request Solution

Week-5

Q.1 Create an applet to find maximum of 3 numbers taking input from html file by parameter.
Submit Answer
Request Solution
Q.2 Write a program to create an Applet having three buttons red,green,blue. On clicking on red 
button the background color should be changed to red,on clicking in blue button the color should 
be changed to blue and so on.
Submit Answer
Request Solution
Q.3 Write a program to make connection to a database of Microsoft access, named employee. 
The table has field’s empno, empname, salary, destination, and department. Display all the 
records where department is computer & destination is System Analyst.
Submit Answer
Request Solution
Q.4 WAP in java to check the input characters for uppercase, lowercase,number of digits and 
other characters. Write a program insert a record in employee database, the record is inputted
by user as arguments.
Submit Answer
Request Solution
Q.5 A database named student contains name and grade.WAP to access the database and display
the grade of the student who is selected(Display the names in the dropdown list).
 
Submit Answer
Request Solution

Object passing and return based questions

Q.1 WAP in java to create Box class with parameterized constructor with an object arguement 
to initialize length, breadth and height also create a function volume which returns the volume
of the box and print it in main method.
Q.2 Write  a program in java with class Employee and do the following operations on it
1) Create two constructor default and with Object as parameter to initialize class variables.
2) Create a function calculate which calculates the pf and allownces on the salary of employee
and return the all values as an object
3) Print all the employee aobject associated values returned from calculate functions
Q.3 Create a class Student with following operations
1) create parameterized constructor to initialize the objects
2) create a function isEqual() to check whether the two objects are equal or not which returns
the boolean value and gets two objects
3) print the result in main method if objects are equals or not (take variables as your assumtion)

 

 

 

Loop Based Questions

Q.1 program to print only prime numbers between 1 and 100
Q2 Write a program to print first 20 prime number using java.
Q3 Java program to print the calculation as power of a number to other
e g. input 5 3
output: 125
Q4 Java program to calculate the HCF of two given positive numbers.
Q5 write a program to take n numbers using command line argument and find the maximum
number and minium number among them
Q6 Java program to print the following patterns
a) 1
222
33333
4444444

b) 1
212
32123

 

 

 

 

Enquiry about Course

Ask your Question

Click Here

Sharp (2) Tutorials

Video/ C Introduction

Watch video in full size

Video tutorial

Follow by Email
Facebook
Facebook
fb-share-icon
YouTube
Copyright © Sharp Tutorial
Build with WordPress
Wordpress Social Share Plugin powered by Ultimatelysocial
Sharp Tutorial