Alshifa Hasnain has Published 283 Articles

JavaScript Program to Find a triplet that sum to a given value

Alshifa Hasnain

Alshifa Hasnain

Updated on 27-Dec-2024 19:17:21

518 Views

In this article, we will learn to find three numbers in an array that add up to a given sum value using JavaScript. We are going to write a JavaScript program to find a triplet that sums up a given value. This program will make use of nested loops to ... Read More

Java Program to Perform nCr (rcombinations)

Alshifa Hasnain

Alshifa Hasnain

Updated on 27-Dec-2024 19:16:15

886 Views

In this article, we'll learn to perform nCr (Combinations) in Java. In mathematics, nCr (combinations) is a crucial concept that helps determine how many ways you can choose r items from a set of n items, without considering the selection order. It is widely used in fields like probability, statistics, ... Read More

Java Program to create a BigDecimal from a string type value

Alshifa Hasnain

Alshifa Hasnain

Updated on 27-Dec-2024 19:15:53

496 Views

In this article, we will learn to create a BigDecimal from a string value in Java. The BigDecimal class in Java is highly versatile and often used for calculations requiring high precision, such as financial transactions or scientific computations. we'll explore two approaches to creating a BigDecimal from a string ... Read More

Java Program to Parse and Format a Number into Binary

Alshifa Hasnain

Alshifa Hasnain

Updated on 26-Dec-2024 20:42:49

687 Views

In this article, we will learn to parse and format a number into binary using Java. Binary representation plays a crucial role, especially when working with low-level operations, data storage, or network communication. Java, a widely used object-oriented programming language, provides several tools to manipulate numbers and convert them into ... Read More

Java Program to get maximum value with Comparator

Alshifa Hasnain

Alshifa Hasnain

Updated on 26-Dec-2024 20:42:05

758 Views

In Java, the Comparator interface is used to define a custom ordering for objects in various Collections. This can be particularly useful when you need to find the maximum or minimum element based on specific criteria rather than natural ordering. One common use case is finding the maximum value in ... Read More

Java Program to create a vertical ProgressBar

Alshifa Hasnain

Alshifa Hasnain

Updated on 24-Dec-2024 17:55:32

534 Views

In this article, we will learn about creating a vertical progress bar using JProgressBar.VERTICAL in Java. Progress bars are essential for tracking task completion in GUI applications, and a vertical orientation can add a unique touch to your design. What is a Progress Bar in Java Swing? A progress bar ... Read More

Java program to display prime numbers between intervals using function

Alshifa Hasnain

Alshifa Hasnain

Updated on 24-Dec-2024 17:46:58

570 Views

In this article, we will understand how to display prime numbers between intervals using a function in Java. We will be using two approaches: one with user input and the other with predefined input. Prime numbers The prime numbers are special numbers that have only two factors 1 and itself and ... Read More

How to add a new row to JTable with insertRow() in Java Swing

Alshifa Hasnain

Alshifa Hasnain

Updated on 24-Dec-2024 17:46:46

8K+ Views

The JTable component in Java Swing is widely used for displaying and managing tabular data. Adding a new row dynamically to a JTable can enhance user interactivity, especially in applications that require real-time data manipulation. In this article we will tell you a step-by-step procedure, to use the insertRow() method ... Read More

JavaScript - Checking for pandigital numbers

Alshifa Hasnain

Alshifa Hasnain

Updated on 24-Dec-2024 17:46:09

517 Views

In this article, we will learn two approaches to check if a number is pandigital using JavaScript. Pandigital numbers are fascinating because they include each digit at least once within a specific range. Checking if a number is pandigital can be a common problem in programming challenges or number theory ... Read More

JavaScript map value to keys (reverse object mapping)

Alshifa Hasnain

Alshifa Hasnain

Updated on 24-Dec-2024 17:45:53

1K+ Views

In JavaScript, there are scenarios where we need to reverse the mapping of keys and values in an object, creating a new object where the original values become keys, and the keys become their corresponding values. For example, cities can be grouped by their states. In this article, we’ll learn ... Read More

Advertisements