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 | WriteDen

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"

    HOW OUR WEBSITE WORKS

    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.

    Step 1

    To make an Order you only need to click ORDER NOW and we will direct you to our Order Page at WriteDen. 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.
     Deadline range from 6 hours to 30 days.

    Step 2

    Once done with writing your paper we will upload it to your account on our website and also forward a copy to your email.

    Step 3
    Upon receiving your paper, review it and if any changes are needed contact us immediately. We offer unlimited revisions at no extra cost.

    Is it Safe to use our services?
    We never resell papers on this site. Meaning after your purchase you will get an original copy of your assignment and you have all the rights to use the paper.

    Discounts

    Our price ranges from $8-$14 per page. If you are short of Budget, contact our Live Support for a Discount Code. All new clients are eligible for 20% off in their first Order. Our payment method is safe and secure.

    Please note we do not have prewritten answers. We need some time to prepare a perfect essay for you.