Chat with us, powered by LiveChat Create an ArrayList of strings and call it parks. Read in the names of national parks from the user until the use - Writeedu

Create an ArrayList of strings and call it parks. Read in the names of national parks from the user until the use

 

  • Create an ArrayList of strings and call it parks.
  • Read in the names of national parks from the user until the user enters done (or DONE,
    or dOnE, .. )  Keep in mind, that the names of some national parks consist of more than one word, for example, Mesa Verde.
    As you read in the national parks, add them to the list.
  • Next, we are going to build a string based on the elements in the list parks. Since the text keeps changing as we add one park at a time, we use class StringBuilder for this task.  
  • Use a StringBuilder  called sb to create the string  nationalParks  .
  • Loop through all the elements of the list  parks and add them one at a time.
    The resulting string should have the following format:
    Favorite National Parks: {park1} | {park2} | . . . | {parkN}
    The parks are separated by a space, a vertical bar, and another space. However, there is no vertical bar after the last element. {park1}, {park2}, {parkN} are the various list elements with updated spelling.
  • Create a private method to update the spelling.
    We can't control whether the user enters the park names in uppercase or lowercase letters. However, we can change the names to a spelling where all letters are lowercase except for the first letters of each individual word. In order to make those changes, create a private method called updateSpelling. It has the following method header:
    private static String updateSpelling(String text)
    E.g.: When you pass the string "MESA VERDE" the method returns "Mesa Verde"
    E.g.: When you pass  "yEllOwstOnE" it returns "Yellowstone"
    E.g.: Passing "black canyon of the gunnison" returns "Black Canyon Of The Gunnison"
    E.g.: Passing  "Denali" returns "Denali"

    Our website has a team of professional writers who can help you write any of your homework. They will write your papers from scratch. We also have a team of editors just to make sure all papers are of HIGH QUALITY & PLAGIARISM FREE. To make an Order you only need to click Ask A Question and we will direct you to our Order Page at WriteEdu. Then fill Our Order Form with all your assignment instructions. Select your deadline and pay for your paper. You will get it few hours before your set deadline.

    Fill in all the assignment paper details that are required in the order form with the standard information being the page count, deadline, academic level and type of paper. It is advisable to have this information at hand so that you can quickly fill in the necessary information needed in the form for the essay writer to be immediately assigned to your writing project. Make payment for the custom essay order to enable us to assign a suitable writer to your order. Payments are made through Paypal on a secured billing page. Finally, sit back and relax.

    Do you need an answer to this or any other questions?

    Do you need help with this question?

    Get assignment help from WriteEdu.com Paper Writing Website and forget about your problems.

    WriteEdu provides custom & cheap essay writing 100% original, plagiarism free essays, assignments & dissertations.

    With an exceptional team of professional academic experts in a wide range of subjects, we can guarantee you an unrivaled quality of custom-written papers.

    Chat with us today! We are always waiting to answer all your questions.

    Click here to Place your Order Now