Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please code the following prorgam in java Command Write a fully-documented interface named Command to represent each command entered on the phone app. The Command

Please code the following prorgam in java

image text in transcribed

image text in transcribed

image text in transcribed

Command Write a fully-documented interface named Command to represent each command entered on the phone app. The Command interface will require the following methods . public boolean vaidCommand (CommandStack stack) Retums whether this Command is valid and can be added to the given CommandStack. Specific behavior will be outlined in the following classes .public String toString0 Retums the String representation of this Command in long form (for current screen display) .public String toShortString(O Retums the String representation of this Command in short form (for stack display) ap Commands .FindPlace implements Command write a fully-documented class named FindPlace to represent theF: Find a place" command for the Maps app. This class requires the following properties (with NO mutators, accessors are allowed) and methods private String destination - public FindPlace(Scanner scanner) public boolean validCommand(CommandStack stack) public String toStringO public String toShortStringO .Constructs this FindPlace instance accordingly using the Scanner . Retums whether or not pushing this FindPlace command will be valid for the given stack. . Retums the String representation of this Command in long form (for current screen display) . Retums the String representation of this Command in short form (for stack display) PlanRoute implements Command Write a fully-documented class named PlanRoute to represent the "P: Plan a route command for the Maps app. This class requires the following properties (with NO mutators, accessors are allowed) and methods private String source private String destination public PlanRoute(Scanner scanner) public boolean validCommand(CommandStack stack) public String toStringO public String toShortStringO .Constructs this PlanRoute instance accordingly after reading input from the scanner . Retums whether or not pushing this PlanRoute command will be valid for the given stack. . Retums the String representation of this Command in long form (for current screen display) . Retums the String representation of this Command in short form (for stack display) StartNavigation implements Command Write a fully-documented class named StartNavigation to represent the "N: Start Navigation" command for the Maps app. This class requires the following properties (with NO accessors and mutators) and methods private String source private String destination public StartNavigation (CommandStack commandStack,) .Constructs this StartNavigation instance accordingly aftergrabbing navigation information from the last instruction public boolean validCommand(CommandStack stack) . Retums whether or not pushing this StartNavigation command will be valid for the given stack. This cannot be placed on top of another StartNavigion command or an empty stack . Retums the String representation of this Command in long form (for current screen display) . Retums the String representation of this Command in short form (for stack display) public String toStringO public String toShortStringO Command Write a fully-documented interface named Command to represent each command entered on the phone app. The Command interface will require the following methods . public boolean vaidCommand (CommandStack stack) Retums whether this Command is valid and can be added to the given CommandStack. Specific behavior will be outlined in the following classes .public String toString0 Retums the String representation of this Command in long form (for current screen display) .public String toShortString(O Retums the String representation of this Command in short form (for stack display) ap Commands .FindPlace implements Command write a fully-documented class named FindPlace to represent theF: Find a place" command for the Maps app. This class requires the following properties (with NO mutators, accessors are allowed) and methods private String destination - public FindPlace(Scanner scanner) public boolean validCommand(CommandStack stack) public String toStringO public String toShortStringO .Constructs this FindPlace instance accordingly using the Scanner . Retums whether or not pushing this FindPlace command will be valid for the given stack. . Retums the String representation of this Command in long form (for current screen display) . Retums the String representation of this Command in short form (for stack display) PlanRoute implements Command Write a fully-documented class named PlanRoute to represent the "P: Plan a route command for the Maps app. This class requires the following properties (with NO mutators, accessors are allowed) and methods private String source private String destination public PlanRoute(Scanner scanner) public boolean validCommand(CommandStack stack) public String toStringO public String toShortStringO .Constructs this PlanRoute instance accordingly after reading input from the scanner . Retums whether or not pushing this PlanRoute command will be valid for the given stack. . Retums the String representation of this Command in long form (for current screen display) . Retums the String representation of this Command in short form (for stack display) StartNavigation implements Command Write a fully-documented class named StartNavigation to represent the "N: Start Navigation" command for the Maps app. This class requires the following properties (with NO accessors and mutators) and methods private String source private String destination public StartNavigation (CommandStack commandStack,) .Constructs this StartNavigation instance accordingly aftergrabbing navigation information from the last instruction public boolean validCommand(CommandStack stack) . Retums whether or not pushing this StartNavigation command will be valid for the given stack. This cannot be placed on top of another StartNavigion command or an empty stack . Retums the String representation of this Command in long form (for current screen display) . Retums the String representation of this Command in short form (for stack display) public String toStringO public String toShortStringO

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_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

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

Get Started

Students also viewed these Databases questions

Question

What lessons in OD contracting does this case represent?

Answered: 1 week ago

Question

Does the code suggest how long data is kept and who has access?

Answered: 1 week ago