In this ICE you will practice writing functions and follow guidelines discussed in class. Create the...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
In this ICE you will practice writing functions and follow guidelines discussed in class. Create the following functions and a main to test them. Functions: - Function called drawStars: this function returns nothing. It takes a non decimal number and when called will print stars equal to the value of its parameter. o For example drawStars(5) will generate the following output: ***** Function called printStatement: this function returns nothing. It takes a string parameter and print the contents of that string. o For example printStatement("This is ICE2") will generate the following output: This is ICE2 - Function called multiplyNumbers: this function takes two non decimal parameters, calculates and return their product (value of their multiplication). Overload the multiply Numbers to do the same job described in the previous step but using decimal parameters. - A palindrome is a word, phrase, number, or other sequences of characters which reads the same backward or forward. Examples include "radar", "level", and "deified". o Write a recursive method in Java named isPalindrome that takes a String as its parameter and returns a boolean value indicating whether the string passed is a palindrome or not. The function should be case insensitive and consider only alphabetic characters (ignoring spaces, punctuation, and numbers). isPalindrome ("Radar"); // Output: true // Output: false isPalindrome ("Hello"); isPalindrome ("A man, a plan, a canal, Panama!"); // Output: true - Each of your functions must have docstyle function headers. In this ICE you will practice writing functions and follow guidelines discussed in class. Create the following functions and a main to test them. Functions: - Function called drawStars: this function returns nothing. It takes a non decimal number and when called will print stars equal to the value of its parameter. o For example drawStars(5) will generate the following output: ***** Function called printStatement: this function returns nothing. It takes a string parameter and print the contents of that string. o For example printStatement("This is ICE2") will generate the following output: This is ICE2 - Function called multiplyNumbers: this function takes two non decimal parameters, calculates and return their product (value of their multiplication). Overload the multiply Numbers to do the same job described in the previous step but using decimal parameters. - A palindrome is a word, phrase, number, or other sequences of characters which reads the same backward or forward. Examples include "radar", "level", and "deified". o Write a recursive method in Java named isPalindrome that takes a String as its parameter and returns a boolean value indicating whether the string passed is a palindrome or not. The function should be case insensitive and consider only alphabetic characters (ignoring spaces, punctuation, and numbers). isPalindrome ("Radar"); // Output: true // Output: false isPalindrome ("Hello"); isPalindrome ("A man, a plan, a canal, Panama!"); // Output: true - Each of your functions must have docstyle function headers.
Expert Answer:
Answer rating: 100% (QA)
Function called drawStars Java public static void drawStarsint n for int i 0 i n i System... View the full answer
Related Book For
Ethical Obligations and Decision Making in Accounting Text and Cases
ISBN: 978-1259969461
5th edition
Authors: Steven M. Mintz, Roselyn E. Morris
Posted Date:
Students also viewed these programming questions
-
x +3 x-4 Multiply and simplify: x2 x - x x 12 x 5
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
You are required to write a Python program that will manage character (heroes and villain) information. Character (hero and villain) information will be stored in a text file that will be read in...
-
The Niakwa Industries prepared the following statement of earnings and comparative statement of financial position for 2020: The Niakwa Industries prepared the following statement of earnings and...
-
If z = x5 - 6x + 4y4 - y2, find z / x and z/y.
-
You just won the TVM Lottery. You will receive $1 million today plus another 10 annual payments that increase by $600,000 per year. Thus, in one year, you receive $1.6 million. In two years, you get...
-
Evaluate human rights from an anthropological perspective.
-
Lauren, Matthew, and Susan form a partnership, with Lauren contributing $100,000; Matthew $50,000; and Susan her time and skill. Nothing is said regarding the division of profits. The firm later...
-
9. An object with a mass of 78kg is on a magnesium material floating on the water. The density of the magnesium is 782 kg/m3 and is barely out of the surface of the water. Determine the volume of the...
-
Natalie had a very busy December. At the end of the month, after Natalie has journalized and posted her adjusting entries, her company has the following adjusted trial balance: Instructions Using the...
-
Suppose that you want to create a backup of your entire data which is around 10GB. Would it be reasonable to use: A. DVD B. CD C. Blu-Ray Disc D. Floppy Disk
-
What causes a tsunami?
-
What are greenhouse gases?
-
What method uses records of past earthquakes to predict future earthquakes? What are the limitations of this method?
-
By how much did the average global temperature rise during the past century?
-
What are the hazards associated with volcanoes?
-
The annual snowfall in city A is 44.9 inches. This is 14.5 inches more than four times the snowfall in city B. Find the annual snowfall for city B.
-
Find a least expensive route, in monthly lease charges, between the pairs of computer centers in Exercise 11 using the lease charges given in Figure 2. a) Boston and Los Angeles b) New York and San...
-
Read the following statements made by Warren Buffet in a letter to shareholders included in the Berkshire Hathaway 2017 Annual Report. Should the external auditors have a role in responding to its...
-
Students who engage in cheating usually rationalize their behavior via what? a. Ethical relativism b. Situation ethics c. Cultural values d. Responsibility
-
How can a board of directors know whether the culture of the organization supports the right kind of risk taking?
-
Using data from a random sample of elementary schools, a researcher regresses average test scores on the fraction of students who qualify for reduced-price meals. The regression indicates a negative...
-
In the study of cigarette demand in this chapter, suppose we used as an instrument the number of trees per capita in the state. Is this instrument relevant? Is it exogenous? Is it a valid instrument?
-
In the demand curve model of Equation (12.3), is \(\ln \left(P_{i}^{\text {butter }} ight)\) positively or negatively correlated with the error, \(u_{i}\) ? If \(\beta_{1}\) is estimated by OLS,...
Study smarter with the SolutionInn App