Course Instructor
Java Program’s
Simple Java Programs
Program based on printing Unicode
Java program to demonstrate the different Escape Sequence.
Java program for find the value in different datatype
Java program to find value in binary operator.
Java program for find value of circle.
Java program for find the value of cube
Java program for division of two number.
Java program to demonstrate the different math function.
Java program to demonstrate the Increment or Decrement of number.
Java program for Type Casting (Implicit & Explicit)
Java Program to how to get value from user using Scanner.
Operators in Java
Condition based Java Programs
Java program to make calculator using switch case
Java program to check even or odd number
Java program to calculate the sum of odd and even number
Java program to find Tangent, Square root, Cube root, Sin, Hypotenous
Java program to calculate electricity bill
Java program to 1) find Pronic number 2) print Frabonii series 3) reverse a given number 4) find tables 5) check Armstrong 6) check prime number 7) check dissarium number 8) check Twisted Prime number
Java program to create small quiz with final report
Java program for restaurant ordering
java program for calculate taxi fare
Java program using switch case to find zodiac signs
Loop based Java Programs
Java program to print even natural numbers using loop
Program to print odd natural numbers using loop
Java program to print multiplication table
Java program for find list of prime numbers between 2 to n
Java program to find a series : 1/x + 2/x +3/x …. n/x
Java program to find the value of 1*1/x*x+2*2/x*x+3*3/x*x….n*n/x*x
Java Program to find Products of Squares of numbers upto N.
Java program to Find the Sum of Square Of Numbers from 1 to N.
Java program to find the given number Fibonacci value
Java program to find the given number Tribonacci value
Java Program for Different Signs.
Java programs to find and print Division Series using Loop
Java program to find and print Division Square Series using Loop
Java Program to check whether a number is palindrome or not.
Java Program to find remainder between two numbers using while loop
Java program to find and print the Sum of Square of the Digits using While Loop
Java program to find and print the Product of the Cube of a Given Digit using While Loop
Java program to find do while factorial using do while Loop
Java program to find Factors using Loop
Java program to find Factors of 105 and 15 using Loops
Java programs to find Fibonacci_Series using Loop
Java programs to find Loop Sum using Loop
This program demonstrate the number number of times inner loop runs based on outer loop. The inner loop is controlled by outer loop
Java program to print Print Matrix Pattern of start where the rows and column size is given as input by user.
Java program to print Row Matrix :
111111
22222
33333
44444
55555
Java Program to print column value in Matrix form using nested loop.
OUTPUT
12345
12345
12345
12345
12345
Java program to print Matrix of continuous number :
OUTPUT
123
456
789
Java programs to print Triangle Pattern using nested loop
Java programs to find Nested_Loop_P5 using Loop
Java program to print column values in triangle pattern :
1
12
123
1234
Java program to print Star Hash Triangle Pattern using nested loop:
OUTPUT
#
#*
#*#
#*#*
Java program to print values of column in Inverted Triangle pattern using nested loop:
OUTPUT
4444
333
22
1
Java program to print values of column in inverted triangle pattern :
OUTPUT
1234
123
12
1
Java program to print Inverted Triangle Pattern of Continuous Number:
OUTPUT
123
45
6
Java program to find PrimeNumber using loop
Java program to find Print Even Number using loop
Java programs to find Print Even Numbers using loops
Java program to find and Print Odd numbers using loop
Java programs to find and print MSG Loop using loops
Java program to find and print Reverse order using loop
Java program to find and print Prod_Digit using loop
Java program to find and print Product Of Series using loop
Java program to find and print Series Different using lops
Java program used to find and print Square Product Series using loop
Java program to find and print Square Sum Series using loop
Java program to find and print Sum_Digits using loop
Java program to find and print Sum Square Digits using loop
Java programs to find and print Sum Average using loops
Java program to find and print Sum_Of_Digits using loop
Java program to find and print Sum Of Odd And Even Numbers using loop
Java program to find and print Sum Of Series using loop
Java program to find and print While_Do_While using loop
Strings based Java Programs
The program include demo of how to use all the string methods
Java program to find Palindrome using String.
Input a line of text from the user and create a new word formed out of the first letter of each word and convert the new word into Uppercase.
Example:
Input: Mangoes are delivered after Midday
Output: MADAM
Write a program to accept a string. Convert the string to uppercase. Count and output the number of Consecutive letter pairs that exist in the string. Sample Input: “IT WAS NOT TOUGH FOR HIM TO RESIDE ABOVE THE HILL” Sample Output: Number of consecutive pair of characters = 6
Write a program in Java to input a Sting from the user and print the frequency of each character present in it. (Character counting is not case sensitive ) Example: Input : Computer Application Output : Character Frequency C 2 o 2 m 1 p 3 u 1 t 2 e 1 r 1 A 2 l 1 i 2 n 1 [Note: Only those characters should be printed which are present in the number]
Program to swap the value of two string variables
Java program code to swap the values of two Strings without using any third (temp) variable.
Write a program to assign a full path and file name as given below. Using library functions, extract and output the file path, file name and file extension separately as shown. Input: C:\Users\admin\Pictures\flower.jpg Output Path: C:\Users\admin\Pictures\ File name: flower Extension: jpg program submitted by : Ms. Rujula Chohan
Write a Java program to input a sentence from the user and display the words which contain the alphabet ‘A’ in them in either Lowercase or Uppercase. Sample Input : All is well that ends well. Sample Ouptut : All that
Define a class WordOp having the following description: Data members/instance variables: str : to store a word max : to store the highest alphabetical character present in the word min : to store the lowest alphabetical character present in the word Member functions: void input() : to accept the word in UPPERCASE void calcMaxMin() : to find the highest and the lowest character present in the word. void display() : to display the word along with the highest and the lowest character. Example: If word is “TWEAK” Highest Character = W Lowest Character = A
To input two words and check whether two words are anagrams or not? The characters of the two words are the same excluding spaces. Example: i) parliament & partial men ii) william shakespeare & i am a weakish speller
To input a word and print its Pig Latin form? Pig Latin word is formed by splitting the original word into two parts from the first vowel of the word. The new word is 2nd part+1st part+ay e.g. simply its Pig Latin form is implysay
Input two words and find out the set that will be formed by the intersection of the characters found in both the string. e.g; Input 1 : DISARI Input 2 : HALDIA Output will come as: D,I,A
Write a program to find the shortest and the longest word in a sentence and print them along with their length. Sample Input: I am learning Java Sample Output: Shortest word = I Length = 1 Longest word = learning Length = 8
Write a program to input a sentence and print its each word separately along with its length E.G. Input:- Aman Kumar Sharma Output:- Aman – 4 Kumar- 5 Sharma- 6
Write a program to input a word from the user and remove the duplicate characters by replacing the sequence of duplicate characters by its single occurrence. Example: INPUT – Jaaavvvvvvvvaaaaaaaaaaa OUTPUT – Java INPUT – Heeeiiiissggoiinggg OUTPUT – Heisgoing
Write a program to accept a sample string and delete all the vowels present in the string. The program also counts deleted vowels and display the new string. Consider the string as: India wins cricket world cup OUTPUT: nd wns crckt wrld cp Number of vowel deleted = 8
This is a simple program in cryptography. Given a string of only uppercase letters, we can encode it in many ways. One simple way is to replace each letter by a letter which is at a fixed distance ahead or behind in the alphabet, where the alphabet is assumed to wrap around. Similarly, we can decode an encoded string.
Java programs using Method and Function
Java program to find and print Addition using function
This program demonstrate how to call a function using value and return the value to the calling function using return keyword.
This program demonstrate use of return statement using addition and multiplication methods
Program to calculate addition and average of three numbers This program demonstrate call-by-value, return keyword
Define a class named MovieMagic with the following description: Instance variables/data members: int year : to store the year of release of a movie String title : to store the title of the movie. float rating : to store the popularity rating of the movie. (minimum rating = 0.0 and maximum rating = 5.0) Member Methods: 1) void accept() : To input and store year, title and rating. 2) void display() : To display the title of a movie and a message based on the rating as per the table below. Rating Message to be displayed 0.0 to 2.0 Flop 2.1 to 3.4 Semi-hit 3.5 to 4.5 Hit 4.6 to 5.0 Super Hit Write a main method to create an object of the class and call the above member methods.
Rocktheit transport company charges for the parcels of its customers as per the following [15] specifications given below: Class name : Transport Member variables: String name – to store the name of the customer int w – to store the weight of the parcel in Kg int charge – to store the charge of the parcel Member functions: void accept ( ) – to accept the name of the customer, weight of the parcel from the user (using Scanner class) void calculate ( ) – to calculate the charge as per the weight of the parcel as per the following criteria. Weight in Kg Charge per Kg Upto 10 Kgs Rs.25 per Kg Next 20 Kgs Rs.20 per Kg Above 30 Kgs Rs.10 per Kg A surcharge of 5% is charged on the bill. void print ( ) to print the name of the customer, weight of the parcel, total bill inclusive of surcharge in a tabular form in the following format : Name. Weight Bill amount ——— ——- ——– Define a class with the above-mentioned specifications, create the main method, create an object and invoke the member methods.
Function Based Program to calculate tax to be paid by the employee based on given conditions
Given below is a hypothetical table showing rates of Income Tax for male citizens below the age of 65 years: Taxable Income (TI) in Rs. Income Tax Does not exceed 1,60,000 Nil Is greater than 1,60,000 and less than or equal to 5,00,000 ( TI – 1,60,000 ) * 10% Is greater than 5,00,000 and less than or equal to 8,00,000 [(TI – 5,00,000 ) *20%] + 34,000 Is greater than 8,00,000 [(TI – 8,00,000 ) *30% ] + 94,000 Write a program to input the age, gender (male or female) and Taxable Income of a person. If the age is more than 65 years or the gender is female, display “wrong category”. If the age is less than or equal to 65 years and the gender is male, compute and display the Income Tax payable as per the table given above.
This program demonstrates method overloading
Multiplication of 2 numbers and 3 numbers using method overloading
Program to find area of square and rectangle using method overloading
Java programs to print Addition oft numbers using call-by-reference
Constructor based Java program
Arrays
Program to demonstrate how to create array in BlueJ IDE
Program to initialise array using index number
This program demonstrate how array is declared and initialised at the same time. The elements of array is printed using index number
Program to print the array elements using loop