A pentagonal number is defined as n(3n1)/2 for n = 1, 2, . . ., and so
Question:
A pentagonal number is defined as n(3n–1)/2 for n = 1, 2, . . ., and so on. Therefore, the first few numbers are 1, 5, 12, 22, . . . .
Write a method with the following header that returns a pentagonal number:
public static int getPentagonalNumber(int n)
Write a test program that uses this method to display the first 100 pentagonal numbers with 10 numbers on each line.
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Answer rating: 84% (13 reviews)
Program plan Step 1 Create a class called PentagonDemo Step 2 Declare and initialize tw...View the full answer
Answered By
Ashington Waweru
I am a lecturer, research writer and also a qualified financial analyst and accountant. I am qualified and articulate in many disciplines including English, Accounting, Finance, Quantitative spreadsheet analysis, Economics, and Statistics. I am an expert with sixteen years of experience in online industry-related work. I have a master's in business administration and a bachelor’s degree in education, accounting, and economics options.
I am a writer and proofreading expert with sixteen years of experience in online writing, proofreading, and text editing. I have vast knowledge and experience in writing techniques and styles such as APA, ASA, MLA, Chicago, Turabian, IEEE, and many others.
I am also an online blogger and research writer with sixteen years of writing and proofreading articles and reports. I have written many scripts and articles for blogs, and I also specialize in search engine
I have sixteen years of experience in Excel data entry, Excel data analysis, R-studio quantitative analysis, SPSS quantitative analysis, research writing, and proofreading articles and reports. I will deliver the highest quality online and offline Excel, R, SPSS, and other spreadsheet solutions within your operational deadlines. I have also compiled many original Excel quantitative and text spreadsheets which solve client’s problems in my research writing career.
I have extensive enterprise resource planning accounting, financial modeling, financial reporting, and company analysis: customer relationship management, enterprise resource planning, financial accounting projects, and corporate finance.
I am articulate in psychology, engineering, nursing, counseling, project management, accounting, finance, quantitative spreadsheet analysis, statistical and economic analysis, among many other industry fields and academic disciplines. I work to solve problems and provide accurate and credible solutions and research reports in all industries in the global economy.
I have taught and conducted masters and Ph.D. thesis research for specialists in Quantitative finance, Financial Accounting, Actuarial science, Macroeconomics, Microeconomics, Risk Management, Managerial Economics, Engineering Economics, Financial economics, Taxation and many other disciplines including water engineering, psychology, e-commerce, mechanical engineering, leadership and many others.
I have developed many courses on online websites like Teachable and Thinkific. I also developed an accounting reporting automation software project for Utafiti sacco located at ILRI Uthiru Kenya when I was working there in year 2001.
I am a mature, self-motivated worker who delivers high-quality, on-time reports which solve client’s problems accurately.
I have written many academic and professional industry research papers and tutored many clients from college to university undergraduate, master's and Ph.D. students, and corporate professionals. I anticipate your hiring me.
I know I will deliver the highest quality work you will find anywhere to award me your project work. Please note that I am looking for a long-term work relationship with you. I look forward to you delivering the best service to you.
3.00+
2+ Reviews
10+ Question Solved
Related Book For
Introduction to Java Programming, Comprehensive Version
ISBN: 978-0133761313
10th Edition
Authors: Y. Daniel Liang
Question Posted:
Students also viewed these Computer science questions
-
A software approach to mutual exclusion is Lamports bakery algorithm [LAMP74], so called because it is based on the practice in bakeries and other shops in which every customer receives a numbered...
-
A compare-exchange operation on two array elements A[i] and A[j], where i < j, has the form COMPARE-EXCHANGE (A, i, j) 1 If A[i] > A[j] 2 exchange A[i] with A[j] After the compare-exchange operation,...
-
For n distinct elements x1, x2, ..., xn with positive weights w1, w2, ..., wn such that Σni =1 wi = 1, the weighted (lower) median is the element xk satisfying
-
Consider constant marginal abatement cost for two firms: (a) Determine the optimal allocation for both firms when the damage function is convex, and when it is linear. (b) Is it possible to achieve...
-
Describe an algorithm that produces the maximum, median, mean, and minimum of a set of three integers. (The median of a set of integers is the middle element in the list when these integers are...
-
Sharpen your written presentation skills, whether it be in formal reports or informal e-mail messages. Challenge yourself to learn more about good writing by paying attention to good reading. lop1
-
Candleton signed a two-year, interest-bearing note payable with a face value of $8,000 and an effective interest rate of 8 percent. Interest payments on the note are made annually. REQUIRED: Provide...
-
Rose Company had no short-term investments prior to year 2015. It had the following transactions involving short-term investments in available-for-sale securities during 2015. Apr. 16 Purchased 4,000...
-
Colt Company produces two skateboard models. Machine time per unit for Hero is two hours and for Filip is one hour. The machine's capacity is 1,840 hours per year. Colt can sell up to 644 units of...
-
Describe an implementation of the positional list methods addLast and addBefore realized by using only methods in the set {isEmpty, first, last, before, after, addAfter, addFirst}.
-
Write a method that computes the sum of the digits in an integer. Use the following method header: public static int sumDigits(long n) For example, sumDigits(234) returns 9 (2 + 3 + 4). To remove 4...
-
Write a program that prompts the user to enter two strings and displays the largest common prefix of the two strings. Here are some sample runs: Enter the first string: Welcome to C++ Enter the...
-
Software to detect fraud in consumer phone cards tracks the number of metropolitan areas where calls originate each day. It is found that 1% of the legitimate users originate calls from two or more...
-
Linear Correlation Coefficient In Exercises 9-12, the linear correlation coefficient r is provided. Use Table 2-11 to find the critical values of r. Based on a comparison of the linear correlation...
-
Problem 5-4A Adjusting entries and multi-step income statement-perpetual LO5 Use the unadjusted trial balance of Electric Bike on December 31, 2020. Cash Accounts receivable Merchandise inventory...
-
Only Brakes Inc. is a start-up company that raised the following debt capital in its first year: notes payable of $10,000,000; long-term bank debt of $35,000,000; and bonds payable of $60,000,000....
-
Find the regression equation, letting the first variable be the predictor (x) variable. Using the listed lemon/crash data, where lemon imports are in metric tons and the fatality rates are per...
-
Danny Imasuen is a 37-year-old student working in Quebec. His wages for the current weekly pay period are $580.00. The employer pays $22.00 for life insurance premiums and $190.00 for group medical...
-
Could you pass a law requiring that every contract have a term in it requiring all parties to it to not hurt the environment in any way? What would be the economic consequences of such a requirement?...
-
Time Travel Publishing was recently organized. The company issued common stock to an attorney who provided legal services worth $25,000 to help organize the corporation. Time Travel also issued...
-
Which of the following method declarations is correct for a static method named displayFacts() if the method receives an int argument? a. Public static int displayFacts() b. Public void...
-
The method with the declaration public static int aMethod(double d) is a method type of _____________. a. static b. int c. double d. You cannot determine the method type.
-
Which of the following is a correct call to a method declared as public static void aMethod(char code)? a. void aMethod(); b. void aMethod('V'); c. aMethod(char 'M'); d. aMethod('Q');
-
What is the Profitability index (PI) of a project that has an initial cash outflow of $317,000 and the following cash inflows? Assume the required return is 12 percent. Year Cash inflow 1 $27,700 2...
-
business Law What is the legal name given to contractual arrangements between a debtor and its creditors for payment of debts that will allow a financially distressed business to continue operating?...
-
A colleague of yours comes to you for advice. S/he's working on a project aimed at improving an urban 6-lane freeway section. This person says to you that the traffic flow for one direction during...
Study smarter with the SolutionInn App