Java | JSP | JSF Answers

Questions: 3 611

Answers by our Experts: 3 611

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 to print the Pascal’s Triangle using a 2-d array.


1. Write a Java program without using a second array to reverse elements of each row of a 2-d array of integer values.

e.g.     1    2   3    4 4    3    2   1

5    6   7    8        8    7    6   5

            9   10  11 12 12  11  10  9



Write a Java program to find the maximum and minimum value of a 1-d array.


Write a java program to find the sum of the series up to the nth term where n is input by the user.

1+(1+n)+(1+n+n)+(1+n+n+n)……………….nth Term

Example: input n = 6

Output: 1+7+13+19+25+31 = 96


Write a Java program that will print the following series until it reaches 100.

 

1 1 2 3 5 8 13 …………………………



Write a java program that inputs an integer and outputs if the number is a Palindrome.



Write a program (without using an array) that accepts three numbers from the user and prints "increasing" if the numbers are in increasing order, "decreasing" if the numbers are in decreasing order, and "Neither increasing or decreasing order" otherwise.

 

Example: Input first number: 1524

Input second number: 2345

Input third number: 3321

 

Expected Output :

 

Increasing order



Write a Java program that reads a positive integer and counts the number of digits the number has.

e.g. Input is 14367, Output is 5.



1. Write a program in Java to display a right-angled triangle pattern with numbers, as shown below.

Expected Output :

1                                                                               

12                                                                              

123                                                                             

1234                                                                            

12345                                                                           

123456                                                                          

1234567                                                                         

12345678                                                                        

123456789                                                                       

12345678910



Write an application for a furniture company; the program determines the price of a table. Ask the user to choose 1 for pine, 2 for oak, or 3 for mahogany. The output is the name of the wood chosen as well as the price of the table. Pine tables cost R 100, oak tables cost R 225, and mahogany tables cost R 310. If the user entered an invalid wood code, set the price to 0 and allow the user to select an option up to 3 times . Save the file as Furniture.java. Marks allocation 1. Presentation of a menu - 10 Select an option 1. for pine 2. for oak 3. for mahogany 2. use of a loop - 10 3. Use of an if statement/ switch - 10 4. correct output -10




LATEST TUTORIALS
APPROVED BY CLIENTS