Home / Questions / Part 1: A pentagonal number is defined as n(3n-1)/2 for n = 1, 2, 3, … and so on. So, the first few
Part 1: A pentagonal number is defined as n(3n-1)/2 for n = 1, 2, 3, … and so on. So, the first few
numbers are 1, 5, 12, 22, … Write the following method that returns a pentagonal number:
public static int getPentagonal Number( int n)
The input (n) is the nth pentagonal number. So, for an input of 2, the method should return 5.
Write a test program that displays the first 100 pentagonal numbers.
Part 2: Write a method that computes the following series:
m(i) = 1/2 + 2/3 + 3/4 + … + i/(i+1)
Write a test program that displays the following table:
i m(i)
1 0.5
2 1.1667
…
19 16.4023
20 17.3546
Do not worry about having a specific number of decimal places in the output.
Part 3: A prime number is called a Mersenne prime if it can be written in the form of 2p – 1 (2 raised to
the p power – 1) for some positive integer p. Write a program that lists all Mersenne primes with p
31.
Note that an int will hold values between -231 and +231 – 1, so an int variable can be used for this
problem.
You do not have to use methods in this problem, but you will likely find it easier to use stepwise
refinement techniques described in section 5.12 of the text to simplify the problem.
Apr 18 2020 Read more Less More
Inves Airbus Invest Dont (170,0) Boeing (0,180) Dont Invest Airbus Dont (0,0) The numbers between parentheses denote payoffs for Boeing and Airbus Question 8 to Question ...
Apr 21 2020Assume that X corp needs 100,000 New Zealand dollars 180 days from now. If the probability distribution isPossible Value of New Zealand Dollars in 180 daysProbability$0.4...
Sep 07 2020the industry is rapidly converging into a monopolistically competitive industryd.all firms have near-equal market sharese.the four-firm concentration ratio exceeds 100 pe...
Dec 12 2019An investor who purchases a call option:Has the right to buy a given stock at a specified price during a designated time period.Has the right to sell a given stock at a s...
Aug 15 2020A Pelton wheel, 2.45 m in diameter, operates under the following conditions:Net head = 370 m; co-efficient of velocity: 0.98; speed ratio = 0.47; relative velocity of wat...
Jun 15 2020On March 1, Mr. and Mrs. Trent formed Trent Properties Inc. through which to operate a real estate management business. Both Mr. and Mrs. Trent worked full-time for modes...
Apr 01 2020A recent study reported that university instructors are frequently required to engage in emotional labour. Identify the situations in which emotional labour is required f...
May 26 2020You are purchasing a 2015 Chrysler 200 for $19,400, with 20% down. The balance will be financed at 7.6% over seven years with monthly payments. Find:Monthly paymentTotal ...
May 14 2018What are the various designations associated with HRM?
Jul 14 2020Give two examples of unethical conduct involving product or service design and the ethical prin- ciples (see Chapter 1) that are violated.1. Examine and compar...
Aug 09 2020Welcome to MyCourseHelp Services, World's leading Academic solutions provider with Millions of Happy Students.