Question: Can someone please help me write these five short java programming programs. Im really having a hard time with them. Thank you. plz make sure

Can someone please help me write these five short java programming programs. Im really having a hard time with them. Thank you. plz make sure you do 5 too . and the shape in 3 is a diamond

Question 1

(Compute ) You can approximate by using the following series:

= 4(1 1/3 + 1/5 1/7 + 1/9 1/11 + +(-1) ^i+1 / 2i -1)

Write a program that displays the value for i = 10000, 20000, , and 100000.

(Hint: You should input the value of i from the user. Also note that the symbol i denoted here does NOT correspond to the variable i, we use as standard notation in loops.)

Question 2

(Perfect number) A positive integer is called a perfect number if it is equal to the sum of all its positive divisors, excluding itself. For example, 6 is the first perfect number because 6 = 3 + 2 + 1. The next is 28 = 14 + 7 + 4 + 2 + 1. There are four perfect numbers less than 10,000. Write a program to find all these four numbers.

Question 3

Write a program to print the pattern shown below

The number of lines (n) will be supplied by the user. For example, the following figure is for n = 9. You can assume that the user will always enter an odd number.

*

***

*****

*******

*********

*******

*****

***

*

Question 4

A Krishnamurthy number is a number whose sum of the factorial of digits is equal to the number itself. Given a number N as input. Write a program to check whether this number is Krishnamurthy number or not.

For example, 145 is a Krishnamurthy number since 145 = 1! + 4! +5!

On the other hand, 434 is not a Krishnamurthy number since 434 is not equal to 4! + 3! + 4!

Question 5

An Armstrong number of three digits is an integer such that the sum of the cubes of its digits is equal to the number itself. Write a program to find all Armstrong number in the range of 0 and 999.

For example, 371 is an Armstrong number since 33 + 73 + 13 = 371.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!