Java is a high-level, robust, object-oriented, and secure programming language. Java was developed by Sun Microsystems (which is now the subsidiary of Oracle) in the year 1995. James Gosling is known as the father of Java.
Here are the 6 basic java exercises to learn, Let's Start the DAY!
1. NUMBER INTO A SINGLE DIGIT:
A Java program to convert a number into a single digit by adding adjacent Numbers.
Sample Output:
Input: N=125
output:8 (1+2+5=8)
program:
OUTPUT:
-----------------------------------------------------------------------------------------------------------------------------
2. Binary into Decimal and Vice Versa:
A Java program to Convert Binary into Decimal and Vice Versa.
program:
OUTPUT:
-----------------------------------------------------------------------------------------------------------------------------
3. Number into Equivalent Words:
A java program to convert a Number into its Equivalent Words.
program:
-----------------------------------------------------------------------------------------------------------------------------
4.
Check if two Strings are equal without using JAVA built-in function:
program:
-----------------------------------------------------------------------------------------------------------------------------
5. Find a Gross salary:
A Java program to find the gross salary of an employee based on his basic DA and HRA.
program:
OUTPUT:
Note : to calculate net salary
Net salary= gross salary-deductions(like income tax)
You can read deductions by your own.
Let's say tax=30,
Income tax=(30/100)*gross salary
-----------------------------------------------------------------------------------------------------------------------------
6. Menu-Driven program :
a java menu-driven program (Here, we considered a food menu).
program:
OUTPUT:-----------------------------------------------------------------------------------------------------------------------------
ABOUT US-
Learner Cycle is a platform where you can learn all computer science Stuff And Tech updates, Marketing Strategies, Fashion, Facts, and Q&A.
Thank you for visiting, Let's meet soon.
Comments
Post a Comment