Skip to main content

6 Basic JAVA Programs that every Beginner Sholud Practice!!


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:



OUTPUT:



-----------------------------------------------------------------------------------------------------------------------------


4.

Check if two Strings are equal without using JAVA built-in function:


program:
OUTPUT:


-----------------------------------------------------------------------------------------------------------------------------

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

Popular posts from this blog

Python Cheat Sheet

LEARNER CYCLE About this Cheat Sheet This cheat sheet includes the materials which give you the overall view of Python.  This cheat sheet tries to provide a basic reference for beginner and advanced developers, lower the entry barrier for newcomers and help veterans refresh the old tricks. Table of Contents :

#TECHIFY - Learnercycle.blogspot.com

#1  $448 Billion smartphone sales just in 2021 0 21 #2    iPhone 13 pro max vs Galaxy S22 Ultra #3 You can run Windows 11 on your phone thanks to Android 13 Android 13  doesn’t seem like a major upgrade at first glance, offering a secure photo picker, themed icons, and new Wi-Fi permission. But it turns out that the update enables users to run alternative operating systems such as Windows 11 in a virtual machine (VM) for more info - https://www.androidauthority.com/windows-11-android-13-3107906/ #4 Lexus reveals more photos of its future electric sports car. Lexus   previewed its Electrified Sport late last year  amongst a gaggle of other EVs the company says is coming by 2030. However, photos of the two-door  sports car  were in short supply back then. That changes today. read here-  https://washingtonnewspost.com/news/auto/lexus-reveals-more-photos-of-its-future-electric-sports-car/ #5 virtual reality rooms A BBC News researcher -...