Karthikeya Boyini has Published 2193 Articles

Java Program to Append Text to an Existing File

karthikeya Boyini

karthikeya Boyini

Updated on 13-Mar-2020 12:39:44

7K+ Views

The Java.io.BufferedWriter class writes text to a character-output stream, buffering characters so as to provide for the efficient writing of single characters, arrays, and strings. To add contents to a file − Instantiate the BufferedWriter class. By passing the FileWriter object as an argument to its constructor. Write data to the file using ... Read More

Java program to calculate the average of numbers in Java

karthikeya Boyini

karthikeya Boyini

Updated on 13-Mar-2020 11:17:58

18K+ Views

An average of a set of numbers is their sum divided by their quantity. It can be defined as −average = sum of all values / number of valuesHere we shall learn how to programmatically calculate average.Algorithm1. Collect integer values in an array A of size N. 2. Add all ... Read More

Java program to calculate student grades

karthikeya Boyini

karthikeya Boyini

Updated on 13-Mar-2020 09:57:09

17K+ Views

The following program accepts average from the user, calculates the grade and prints it.Examplepublic class CalculateStudentGrades {    public static void main(String args[]) {       Scanner sc = new Scanner(System.in);       System.out.println("Enter average of your marks (less than 100)::");       int average = sc.nextInt(); ... Read More

Java program to find the area of a circle

karthikeya Boyini

karthikeya Boyini

Updated on 13-Mar-2020 09:43:27

22K+ Views

Area of a circle is the product of the square of its radius, and the value of PI, Therefore, to calculate the area of a rectangleGet the radius of the circle.Calculate the square of the radius.Calculate the product of the value of PI and the value of the square of ... Read More

Java program to print Fibonacci series of a given number.

karthikeya Boyini

karthikeya Boyini

Updated on 13-Mar-2020 07:25:42

665 Views

Recursion is the process of repeating items in a self-similar way. In programming languages, if a program allows you to call a function inside the same function, then it is called a recursive call of the function.ExampleFollowing is an example to find Fibonacci series of a given number using a ... Read More

Java program to print the transpose of a matrix

karthikeya Boyini

karthikeya Boyini

Updated on 13-Mar-2020 06:16:50

2K+ Views

The transpose of a matrix is the one whose rows are columns of the original matrix, i.e. if A and B are two matrices such that the rows of the matrix B are the columns of the matrix A then Matrix B is said to be the transpose of Matrix ... Read More

Java program to find the largest number in an array

karthikeya Boyini

karthikeya Boyini

Updated on 13-Mar-2020 06:02:57

13K+ Views

To find the largest element of the given array, first of all, sort the array.Sorting an arrayCompare the first two elements of the arrayIf the first element is greater than the second swap them.Then, compare 2nd and 3rd elements if the second element is greater than the 3rd swap them.Repeat ... Read More

Adding rows in an internal table with header line in SAP ABAP

karthikeya Boyini

karthikeya Boyini

Updated on 13-Mar-2020 05:12:12

2K+ Views

Note that you shouldn’t use headers with internal tables. As you are using it, and header of in_table2 is empty. Use the loop to print it as below −LOOP AT in_table2.   "here in_table2 means table (an internal table)   WRITE / in_table2. "here in_table2 means the header of the ... Read More

What does the method toString(int[] a) do?

karthikeya Boyini

karthikeya Boyini

Updated on 13-Mar-2020 05:03:01

99 Views

The toString(int[]) method of the class java.util.Arrays return a string representation of the contents of the specified int array. The string representation consists of a list of the array's elements, enclosed in square brackets ("[]"). Adjacent elements are separated by the characters ", " (a comma followed by a space).Exampleimport ... Read More

Transforming XML file into fixed length flat file in SAP

karthikeya Boyini

karthikeya Boyini

Updated on 12-Mar-2020 12:48:46

685 Views

This is an EDIfact invoice. Try using the script, and it can help −                                                                   ... Read More

Advertisements