This repository contains a collection of Java programs demonstrating various concepts and functionalities.
- File Name:
DataTypeStore.java - Description: This program showcases the usage of different data types in Java and how to store and manipulate data.
- File Name:
DayofWeek.java - Description: This program determines the day of the week based on user input and demonstrates the use of conditional statements.
- File Name:
JavaEOF.java - Description: This program illustrates the use of End-of-File (EOF) in Java when reading input from the console.
- File Name:
evenodd.java - Description: This program checks whether a given number is even or odd and prints the result.
- File Name:
inttostring.java - Description: This program converts an integer to a string and demonstrates string manipulation in Java.
- File Name:
characterOccurrence.java - Description: This program counts occurrences of the characters 'a' (or 'A') and 's' (or 'S') in a given string.
- File Name:
AlternateCharacters.java - Description: This program prints every alternate character in a given string.
- File Name:
runSumCalc.java - Description: The program prompts the user for the number of integers to input (n) and then processes each integer, updating and printing the running sum after each input.
- File Name:
AlternatePositionArrayPrint.java - Description: This program prints elements at alternate positions in an array.
- File Name:
GCD.java - Description: This program calculates the Greatest Common Divisor (GCD) of two numbers.
- File Name:
Permutation.java - Description: This program generates and prints all permutations of a given string.
- File Name:
addOne.java - Description: This program adds 1 to the last digit of a given number.
- File Name:
addTwoArray.java - Description: This program adds two arrays element-wise and prints the result.
- File Name:
characterOccurence.java - Description: This program counts occurrences of the characters 'a' (or 'A') and 's' (or 'S') in a given string.
- File Name:
diamondPattern.java - Description: This program prints a diamond pattern using asterisks.
- File Name:
divideAndSteps.java - Description: This program calculates the number of steps needed to reach 1 by repeatedly dividing a number by 2.
- File Name:
dumrooPattern.java - Description: This program prints a pattern resembling the shape of a dumroo (Indian drum).
- File Name:
examresult.java - Description: This program takes exam scores as input and determines the result (pass or fail) based on a predefined passing threshold.
- File Name:
factorial.java - Description: This program calculates the factorial of a given number.
- File Name:
findIndex.java - Description: This program finds and prints the index of a specific element in an array.
- File Name:
firstIndexOfX.java - Description: This program finds and prints the first index of the element 'X' in an array.
- File Name:
hollowRectangle.java - Description: This program prints a hollow rectangle pattern using asterisks.
- File Name:
hollowSquareWithoutTop.java - Description: This program prints a hollow square pattern without the top side using asterisks.
- File Name:
identicalArray.java - Description: This program checks if two arrays are identical (have the same elements in the same order).
- File Name:
invertedRightAngleTriangle.java - Description: This program prints an inverted right-angle triangle pattern using asterisks.
- File Name:
invertedTriangle.java - Description: This program prints an inverted triangle pattern using asterisks.
- File Name:
isArmstrong.java - Description: This program checks whether a given number is an Armstrong number.
- File Name:
isPrime.java - Description: This program checks whether a given number is a prime number.
- File Name:
leapyear.java - Description: This program checks whether a given year is a leap year.
- File Name:
modifyIndex.java - Description: This program modifies the value at a specified index in an array.
- File Name:
nCrCalculate.java - Description: This program calculates the combination (nCr) of two given numbers, representing "n choose r."
- File Name:
nonMatchingNumberFirstPosition.java - Description: This program finds and prints the position of the first non-matching element in two arrays.
- File Name:
numberFormReverse.java - Description: This program takes a number as input, reverses its digits, and prints the reversed number.
- File Name:
numberOfSteps.java - Description: This program calculates and prints the number of steps needed to reduce a given number to zero, following a specific set of rules.
- File Name:
pattern.java - Description: This program prints a pattern using numbers in a specific sequence.
- File Name:
perfectnumber.java - Description: This program checks whether a given number is a perfect number.
- File Name:
productExceptSelf.java - Description: This program calculates the product of all elements in an array, except for the element at the current position.
- File Name:
pyramid.java - Description: This program prints a pyramid pattern using asterisks.
- File Name:
removeElementandPrintSize.java - Description: This program removes a specified element from an array and prints the size of the modified array.
- File Name:
rightAngleNumberPattern.java - Description: This program prints a right-angled number pattern using integers.
- File Name:
rightAngleTriangle.java - Description: This program prints a right-angled triangle pattern using asterisks.
- File Name:
rightAngleTriangle1.java - Description: This program prints a right-angled triangle pattern with numbers in ascending order.
- File Name:
runSumCalc.java - Description: This program prompts the user for the number of integers to input (n) and then processes each integer, updating and printing the running sum after each input.
- File Name:
salaryCalc.java - Description: This program calculates the net salary of an employee based on the basic salary and allowances.
- File Name:
secondLargestArray.java - Description: This program finds and prints the second-largest element in an array.
- File Name:
squareLadder.java - Description: This program prints a square ladder pattern using asterisks.
- File Name:
sumOfElementsExceptSelf.java - Description: This program calculates the sum of all elements in an array, excluding the element at the current position.
- File Name:
swapUsingBitwise.java - Description: This program swaps two numbers using bitwise XOR operations.
- File Name:
targetArray.java - Description: This program checks if it is possible to reach a target array from another array by performing specific operations.
- File Name:
timeconverter.java - Description: This program converts time from 24-hour format to 12-hour format.
To run these programs in Visual Studio Code, follow these steps:
-
Install Java:
- Ensure that you have Java installed on your machine. You can download it from Java's official website.
-
Install Visual Studio Code:
- Download and install Visual Studio Code from VS Code's official website.
-
Install Java Extension Pack:
- Open VS Code and go to Extensions (or press
Ctrl + Shift + X), then search for "Java Extension Pack" and install it.
- Open VS Code and go to Extensions (or press
-
Open Project in VS Code:
- Clone this repository to your local machine using Git.
- Open the cloned project folder in Visual Studio Code.
-
Run Java Programs:
- Navigate to the specific program file (e.g.,
DataTypeStore.java) in the VS Code Explorer. - Open the file and run the program using the integrated terminal or the "Run" button.
- Navigate to the specific program file (e.g.,
Feel free to contribute, provide feedback, or suggest improvements. Happy coding!