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: 81% (11 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...
-
Answer each of the following as "true" or "false", choosing the answer that applies to you.* 1. _____T/F I would consider myself to be a loner 2. _____T/F I am a risk taker 3. _____T/F I enjoy...
-
What stakeholder affected by their behavior was Gilead weighting very lightly when it decided what to tell the FDA about the medicines it wished to have permission to sell?
-
Derby Company prepares monthly cash budgets. Relevant data from operating budgets for 2014 are: All sales are on account. Collections are expected to be 60% in the month of sale, 25% in the first...
-
An annuity, paid in advance, is indexed to inflation at a rate of r% per period. What is the present value of this indexed annuity given a requirement of an effective investment rate of i% per period...
-
The mobile in Fig. 9-71 is in equilibrium. Object B has mass of 0.885 kg. Determine the masses of object A, C, and D. (Neglect the weights of the crossbars) 7.50 cm 30.00 cm 15.00 cm 5.00 cm 17.50 cm...
-
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...
-
Briey describe or dene the following three items: revenues, gross profit, and net income.
-
What is 'tailoring the process' in context of project management?
-
The term structure of interest rates is flat at 8%. You want to immunize a liability of $1,000 maturing in 7 years. To do so you may invest in a combination of the following a perpetuity with a...
-
A 2.0-mm-diameter, 50-cm-long copper wire carries a 2.5 A current. What is the potential difference between the ends of the wire? (mV)
-
Prepare Journal Entry ? Accounts Cash Accounts Receivable Supplies Equipment Accumulated Depreciation Salaries Payable Common Stock Retained Earnings Totals Debits Credits $ 13,500 6,700 2,700 16,500...
-
The manufacturing costs of Ackerman Industries for the first three months of the year follow: Total Costs Units Produced January $60,280 1,440 units February 56,160 845 March 87,360 2,145 Using the...
-
Identify three audit-related tasks that may be performed with the use of a microcomputer.
-
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');
-
Analyzing Activity in Inventory Accounts Selected data concerning operations of Cascade Manufacturing Company for the past fiscal year follow: Raw materials used $400,000 Total manufacturing costs...
-
Supler Corporation produces a part used in the manufacture of one of its products. The unit product cost is $21, computed as follows: Direct materials Direct labor Variable manufacturing overhead...
-
Explain the concept of social entrepreneurship with theoretical models and examples. Give some suggestions, on how the Prime Group Sri Lanka in the discussion can be involved in social...
Study smarter with the SolutionInn App