Java | JSP | JSF Answers

Questions: 4 418

Answers by our Experts: 3 943

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

Write a java program that accepts a given n, then create a 2D array with n rows and n columns. Then for each cell the value should be n+row to the power column. For example if we talk of n=5, then array[0][0] =(5+0)0 = 1. Print out all the values in the array created.


In Java, Write a program to store 20 numbers in an array then display those numbers in one column and the digits in another column with comma within the digits as follows:

2345 2,3,4,5

260 2,6,0


Define a class IncomeTax having the following description:

Data members/instance variables

int pan - to store permanent account number

String name - to store name of person

int income - to store annual income of the person

double tax - to store tax to be paid by the person

Member functions:

IncomeTax () -- constructor to initialize pan as 0, name as null and income as 0

input() - to accept pan, name and income.

calculate() - to calculate tax for a person as per following condition

Total Income Tax (in %)

Less than Rs. 200000 8%

Rs. 200001 to Rs. 500000 15%

Rs. 500001 to Rs. 100000 25%

Above Rs. 100000 30%

display()- To display the details.

Create an object in the main() method and invoke the above function to perform the above work. 


WAP to take two numbers as input then display all Armstrong number within them in descending order in one line. Also display how many such numbers found using following method prototype: int armstrong(int a,int b)

where a=99 and b<=1000.


Write a program in java which will display whether two numbers entered by the user are amicable pair or not using the following method prototype : void amicable ( int m, int n)

Hint: Amicable pair means “Sum of factors of first number excluding the number itself, is same with second number and sum of factors of second number excluding the number itself, is same with first number.


Write a program in java to display first 20 numbers of Harsh Series: 1, 2, 5, 12, 29, 70 using following method prototype: void harsh_series()

Hint: The series starts with 1 & 2 and subsequent numbers are the sum of twice the previous number and number previous to previous number.


In Java, WAP to take two numbers as input then display whether they are twin prime or not using the following method prototype : String twin(int m ,int n).


In Java, WAP to store name and age of 30 persons in two different arrays. Ask the age range from the use and then display name of those persons who are coming in that age group in descending order of their age. At the end display how many such persons found.


In Java, WAP to store 5 numbers in one array then another 5 numbers in another array then create a new array to merge those two array keep the common values of both the array. Display the valued of merged array and also display how many such numbers found.


Write a program in Java to store 25 numbers in an array then create another array to store sum of the digits. Then display only those numbers in ascending order where sum of the digits is a single digit. 


LATEST TUTORIALS
APPROVED BY CLIENTS