Accept a character parameter

Assignment Help Business Management
Reference no: EM131441508

Write a recursive method called printLettersForward that will accept a character parameter. The method should print all of the letters of the alphabet up to (including) the parameter value. For example, if the parameter passed to the method is 'f', the method should print:

abcdef

The sequence of characters printed should be the same case as the parameter. If the parameter value is 'D' (uppercase), then the method should print:

ABCD

If the parameter value is not a letter of the alphabet, do not print anything. Do not return anything.

public static void printLettersForward(char c) { }

2. Copy the printLettersForward method and rename it printLettersBackwards. Change the method so that it prints the letters in reverse order. . If the parameter value is 'D' (uppercase), then the method should print:

DCBA

3. Write a recursive method called triangle that will display a triangle made of asterisks. The only parameter is an integer that determines the number of asterisks to print on the current line. Do not return anything. For example, if the test call to this method is triangle(5), the output should look like:

*

**

***

****

*****

public static void triangle(int n) { }

. 4. Copy the triangle method and rename it upsideDownTriangle. Change the method so that the longest line of asterisks prints first. If the parameter value is 5, the method should print:

*****

****

***

**

*

5. Write a method called powerOfTen that will find and return 10n for any integer n (n is the parameter). The method should return a double value.

Examples:

powerOfTen(3) should return 1000.0

powerOfTen(-3) should return 0.001

The method should not print anything.

public static double powerOfTen(int n) { }

Part B: Create a main method within the same program. Do not create a separate test program. Put a main method in Lab9.java. Add calls to the main to test each method as many times as needed to insure that all cases are working correctly.

This is a study worksheet for my upcoming exam, and Im not very good at recusive methods, and was wondering if anyone could show me how to do it. If you can I would be grateful, thank you in advanced to anyone who helps me.

Reference no: EM131441508

Questions Cloud

Discuss the purpose of using a diagnostic instrument : Discuss the purpose of using a diagnostic instrument/model to help manage change. Describe the key aspects that an instrument/model should effectively identify or outline in order to facilitate change.
Snooping and directory protocol implementations : What is false sharing and how does it affect parallelism in a program explain using the necessary architectural details? How can you prevent or reduce the impact of it's occurence? What is cache coherence and how do the snooping and directory prot..
Which motivational methods would you as a manager apply : Within your organization, upper management has decided that your department must be downsized, and it is up to each manager to begin preparing his or her team for the changes. One of the changes to be addressed involves motivational techniques.
Differences between original budget and the amended budget : What are the differences between the original budget and the amended budget, and what are the reporting objectives that are served by requiring both to be presented?
Accept a character parameter : Write a recursive method called printLettersForward that will accept a character parameter. The method should print all of the letters of the alphabet up to (including) the parameter value. For example, if the parameter passed to the method is 'f'..
Implemented using min-heap : We discussed the priority queue (PQ) ADT implemented using min-heap. In a minheap,the element of the heap with the smallest key is the root of the binary tree. On the other hand, amax-heap has as root the element with the biggest key, and the rela..
Explain the ways in which findings might be used in nursing : In a 1000-1,250 word essay, summarize the study, explain the ways in which the findings might be used in nursing practice, and address ethical considerations associated with the conduct of the study.Refer to the resource "Research Critique Guideli..
How household would deciding on purchase a new car : Using the Buyer Decision Process in Figure 5.4 show how each household would go about deciding on the purchase of a new car. Make sure you include enough details to clearly identify any differences between the two households
Explain the theory of comparative advantage : Explain how the theory of comparative advantage relates to the need for international business.

Reviews

Write a Review

Business Management Questions & Answers

  Please identify the issues in business

Notes to students1 Please identify the issues in your answer. There are often severalissues in one question.2 State the legal principle applicable to each issue, including relevantcase law and legislation, then analyse the facts and apply theprincipl..

  Importance of creating a self-picture

Q.1) Willingham addresses the importance of creating a self-picture. In a minimum one paragraph, address how you can create more value for more people than you have been doing?

  Operational crm versus analytical crm

1. How can organizations create value by implementing an advanced information system solution paired with the appropriate business model? 2. Explain operational CRM versus analytical CRM. Under what conditions would a decision maker use either appl..

  Common unemployment rate used by us government

The most common unemployment rate used by the U.S. Government (there are six rates from U1 to U6) counts underemployed people (people working less than full time who want full time work) as employed. Explain why this can be detrimental to the cir..

  Team life cyclediscuss a the phases of a team life cycle b

team life cyclediscuss a the phases of a team life cycle b how to increase a teams potential to survive be productive

  Learning outcomes impact the learning processing

How does not having clear learning objectives that align with the overall learning outcomes impact the learning processing? Please provide an example with your answer.

  Create a reference page by citing the given sources

Create a reference page by citing the following sources in correct APA format. You may use your text or the OWL website to help you, but do not use citation generators.

  What challenges company had to face during the process

How the company made a comeback through its training interventions? What challenges it had to face during the process? What happened in reality. Was it a success or failure?

  Problem regarding the uncertainties in the market

Please see the problem set out below, and answer A & B. Please show all your steps in arriving at the answer. Clearly state the definitions of terms used, and also state any formulas used.

  Employment policies in the company handbook

In an organization, there are many employment policies in the company handbook. This handbook is given to employees at the start of the employer-employee relationship, and although generally not construed as a binding contract against the company ..

  Analyzing and computer security

Suppose four other parties, whom we might call E, F, G, and H, are all working on a common task, so they use one encryption key for all communication. Now, suppose H leaves the project and should no longer have access to encrypted communication. H..

  Consumer perceptions of prices are also affected

Consumer perceptions of prices are also affected by alternative pricing strategies. Marriott Hotels, for example, has different brands for differing price points. Building upon the Marriott example, scan the environment to find examples of a company ..

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd