Answered step by step
Verified Expert Solution
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
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.
Build
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.
# Eliza
# Intent: A list of helpful actions that a troubled person could take. Build
possibleactions taking up yoga. 'sleeping eight hours a night. 'relaxing.
'not working on weekends. 'spending two hours a day with friends.
Precondition: possibleactions is the list defined above
Postconditions:
Welcome: A welcome message is on the console
usercomplaint: usercomplaint is the user's response to a prompt for the
user's complaint
howlong: howlong is the user's string response to "How many months have
you experienced AND Eliza sympathized, mentioning the duration
Advice:
EITHER howlong AND "Please return in months" is on the console where
is howlong
OR howlong AND The phrases in possibleaction are on separate lines
on the console, each preceded by "Try
Here is an example of the interaction:
Build
Implement the functionality specified below.
# Eliza
# Intent: A list of helpful actions that a troubled person could take. Build
possibleactions taking up yoga', 'sleeping eight hours a night', 'relaxing',
'not working on weekends', 'spending two hours a day with friends'
Precondition: possibleactions is the list defined above
Postconditions:
Welcome: A welcome message is on the console
usercomplaint: usercomplaint is the user's response to
"Please describe your emotional complaintin one punctuationfree line:
howlong: howlong is the user's string response to
"How many months between and have you experienced
Month validity: EITHER howlong has the requested form
OR this terminated AND "Sorry, illegal input. Eliza is quitting; run Eliza again."
is on the console
Advice:
EITHER howlong AND "Please return in months" is on the console where
is howlong
OR howlong AND The phrases in possibleaction 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:
Build
Implement the following specifications:
# Eliza
# Intent: A list of helpful actions that a troubled person could take. Build
possibleactions taking up yoga', 'sleeping eight hours a night', 'relaxing',
'not working on weekends', 'spending two hours a day with friends'
Precondition: possibleactions is the list defined above
Postconditions:
Welcome: A welcome message is on the console
usercomplaint: usercomplaint is the user's response to
"Please describe your emotional complaintin one punctuationfree line:
howlong: howlong is the user's string response to
"How many months between and have you experienced
Month validity: EITHER howlong has the requested form
OR this terminated AND "Sorry, illegal input. Eliza is quitting; run Eliza again."
is on the console
Advice: EITHER howlong
OR "Please return in months" is on the console where is howlong
actionsnottaken: actionsnottaken consists of the actions elements in
possibleactions that the user answered n to when questioned "Have you tried..."
Summarized: Eliza recommended that the user take the actions in
actionsnottaken
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started