Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Assignment 3 1 / 2 6 / 1 7 Write an Eliza application that fulfills the postcondition specifications below given the precondition. Each part will

Assignment 3
1/26/17
Write an Eliza application that fulfills the postcondition specifications below given the precondition.
Each part will build mostly on the previous one. All builds should be submitted, and are weighted equally. The key to evaluating each part of the assignment is on the table in the Syllabus page, under Grading.
1. Build 1
Implement the functionality specified below. You may use int(), which returns an integer form of a string argument and str(), which returns a string form of an integer argument.
# Eliza300
# Intent: A list of helpful actions that a troubled person could take. Build 1
possible_actions =['taking up yoga.', 'sleeping eight hours a night.', 'relaxing.',
'not working on weekends.', 'spending two hours a day with friends.']
'''
Precondition: possible_actions is the list defined above
Postconditions:
1.(Welcome): A welcome message is on the console
2.(user_complaint): user_complaint is the user's response to a prompt for the
user's complaint
3.(how_long): how_long is the user's string response to "How many months have
you experienced ...?" AND Eliza300 sympathized, mentioning the duration
4.(Advice):
EITHER how_long <3 AND "Please return in * months" is on the console where *
is 3-how_long
OR how_long >=3 AND The phrases in possible_action are on separate lines
on the console, each preceded by "Try ".
'''
'''
Here is an example of the interaction:
2. Build 2
Implement the functionality specified below.
# Eliza300
# Intent: A list of helpful actions that a troubled person could take. Build 2
possible_actions =['taking up yoga', 'sleeping eight hours a night', 'relaxing',
'not working on weekends', 'spending two hours a day with friends']
'''
Precondition: possible_actions is the list defined above
Postconditions:
1.(Welcome): A welcome message is on the console
2.(user_complaint): user_complaint is the user's response to
"Please describe your emotional complaint--in one punctuation-free line: "
3.(how_long): how_long is the user's string response to
"How many months (between 1 and 99) have you experienced ...?"
4.(Month validity): EITHER how_long has the requested form
OR this terminated AND "Sorry, illegal input. Eliza is quitting; run Eliza again."
is on the console
5.(Advice):
EITHER how_long <3 AND "Please return in * months" is on the console where *
is 3-how_long
OR how_long >=3 AND The phrases in possible_action are on separate lines
on the console, each preceded by "Try ".
'''
Here are examples of the interaction and note the tip that follows it:
Depending on how you approach this problem, you may find the following information useful:
3. Build 3
Implement the following specifications:
# Eliza300
# Intent: A list of helpful actions that a troubled person could take. Build 2
possible_actions =['taking up yoga', 'sleeping eight hours a night', 'relaxing',
'not working on weekends', 'spending two hours a day with friends']
'''
Precondition: possible_actions is the list defined above
Postconditions:
1.(Welcome): A welcome message is on the console
2.(user_complaint): user_complaint is the user's response to
"Please describe your emotional complaint--in one punctuation-free line: "
3.(how_long): how_long is the user's string response to
"How many months (between 1 and 99) have you experienced ...?"
4.(Month validity): EITHER how_long has the requested form
OR this terminated AND "Sorry, illegal input. Eliza is quitting; run Eliza again."
is on the console
5.(Advice): EITHER how_long >=3
OR "Please return in * months" is on the console where * is 3- how_long
6.(actions_not_taken): actions_not_taken consists of the actions (elements) in
possible_actions that the user answered 'n' to when questioned "Have you tried..."
7.(Summarized): Eliza300 recommended that the user take the actions in
actions_not_taken
'''
Here is a typical example of an interaction:
Depending on how you implement this, you may find the following useful:

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

Big Data Fundamentals Concepts, Drivers & Techniques

Authors: Thomas Erl, Wajid Khattak, Paul Buhler

1st Edition

0134291204, 9780134291208

More Books

Students also viewed these Databases questions

Question

Would giving rewards or administering punishments be

Answered: 1 week ago

Question

Are your goals SMART?

Answered: 1 week ago