Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

can help me unders better these work package week_7.q1_travel_wish_list; import java.util.ArrayList; import java.util.Collections; import java.util.List; import static input.InputUtils. stringInput ; import static input.InputUtils. yesNoInput ;

can help me unders

better these work

package week_7.q1_travel_wish_list;

import java.util.ArrayList; import java.util.Collections; import java.util.List; import static input.InputUtils.stringInput; import static input.InputUtils.yesNoInput; /** Program to create and display a list of places a user wishes to travel to. */ public class WishList { public static void main(String[] args) { // TODO modify this line so the wishList List stores Place objects List <>wishList = new ArrayList<>(); do { String name = stringInput("Enter the name of the place"); String reason = stringInput("Why do you want to visit " + name + "?"); // TODO use the newPlace method to // create a new Place object with the name, and reason // The Place object's constructor should calculate the date created and store that. // TODO add the new Place object, returned by newPlace, to the wishList } while (yesNoInput("More places to add to your wish list?")); // TODO Call the displayPlacesInNameOrder method to print // a list of the places, sorted by name //Display th wishList } public static Place newPlace(String placeName, String reason) { // TODO create a new Place object with the given placeName and reason } public static void displayPlacesInNameOrder(List places) { // TODO // Sort the List of Place objects, places should be sorted in name order. // the sort should be case insensitive. 'hawaii' should be before 'Rome'. // Print each place, one per line // Don't print anything else // Make sure you've made Place Comparable, and it has a toString method } }

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Contemporary Management

Authors: Gareth Jones, Jennifer George

9th Edition

0077718372, 978-0077718374

More Books

Students also viewed these Programming questions

Question

Describe the reasons organizational members may resist change.

Answered: 1 week ago