Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Recognize Known Commands Extend Monty 1 code to work as follows: It recognizes the list command and responds with a fixed message. It recognizes the

Recognize Known Commands

Extend Monty 1 code to work as follows:

It recognizes the list command and responds with a fixed message.

It recognizes the exit command and exits the program if user confirms.

For all other inputs, it responds with a fixed error message.

A sample session is given below.

You are highly encouraged to give the software a different name (i.e., not Monty), define your own command formats (e.g., show instead of list), and even a different personality (e.g., you can make its questions/responses sound similar to a popular video game character). Differentiating your software in those ways will reduce the risk of plagiarism concerns.

>>> Hello, my name is Monty >>> What can I do for you? list >>> Nothing to list >>> What can I do for you? foo >>> OOPS! Unknown command >>> What can I do for you? exit >>> Are you sure? y/n n >>> What can I do for you? exit >>> Are you sure? y/n y >>> Bye!

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

Learning PostgreSQL

Authors: Salahaldin Juba, Achim Vannahme, Andrey Volkov

1st Edition

178398919X, 9781783989195

More Books

Students also viewed these Databases questions

Question

Compute the derivative f(x)=(x-a)(x-b)

Answered: 1 week ago

Question

5. Tell how job experiences can be used for skill development.

Answered: 1 week ago

Question

4. Explain the characteristics of successful mentoring programs.

Answered: 1 week ago