首页
网站开发
桌面应用
管理软件
微信开发
App开发
嵌入式软件
工具软件
数据采集与分析
其他
首页
>
> 详细
代写CMSC 150、代做Python设计程序
项目预算:
开发周期:
发布时间:
要求地区:
README.md 2025-01-27
1 / 3
Simple Chatbot
CMSC 150-[01/02] - Spring 2025 - Project 1
Introduction
Most AI agents, particularly chatbots (see ELIZA, one of the first chatbots and Eugene Gootsman, the first
chatbot to pass the Turing Test), are really just made up of complex "if-else" statements. For this project, you
are going to make an extremely simple chatbot. In it, you'll check for keywords and phrases and have the
chatbot give unique responses.
Topics Covered
variable assignment and updating
user input
print statements and formatting
if-else conditionals
comparison
arithmetic
boolean conditioning
data types
Starter Code
A starter code file is given for you in simplebot-p1-TEMPLATE.py (replace 'TEMPLATE' with your last name). In
it, there are some global variables needed for the assignment (see Instructions), an infinite while loop to keep
the interaction going, and user input.
Instructions
1. Before the while loop, ask the user for their name and save it to the user_name variable.
2. Inside the while loop, write a total of 9 conditional statements (if, elif, else) that prints out a response
to user input. These responses must be distinct.
3 statements must check if a certain word is in the input
Example:
if "hello" in user_input:
print("Hello!")
3 additional statements must check if an exact phrase is said by the user
Example:
README.md 2025-01-27
2 / 3
if user_input == "What is your favorite color?":
print("My favorite color is black.")
1 additional statement must check if a "magic word" (saved in the variable MAGIC_WORD) is said
by the user. If so, the counter value magic_word_ct must be incremented by 1.
1 additional statement must check if the user has said 2 passwords -- saved as variables
PASSWORD1 and PASSWORD2 -- in the same input. If so, set the unlocked_password to true. Both
words must be said in the same input in order to activate. The words cannot be the same.
1 additional statement acts as a default statement regardless of the user input. 1 randomly
chosen response out of 4 possible responses must be printed out. These 4 possible condition
checks do not count towards the 9 total.
HINT: Use the random.randint(min,max) function to randomly pick a response
The user's name and the bot's name must be printed at some point during the program runtime.
This can be at the beginning, during the chat session, or at the end.
3. Outside of the while loop, print a goodbye message and 2 additional sentences based on 2 conditions:
If the magic word was said, print how many times it was said during the chat session.
If the user correctly said both passwords, and the unlocked_password is true, print the
SECRET_MESSAGE.
If neither of these conditions were met, you don't have to print anything else.
Example Use Case
This chat shows the conversation between the user "M" and a chatbot named "Alphonse" -- who is secretly a
cow. The user input is denoted with a ">" before the phrase.
The responses and inputs are annotated on the right side for the different phrases, words, magic words, and
password activations.
Note: Not all possible responses are shown and some default responses are repeated.
Note 2: Notice that when the user inputs the magic word and password checks, the bot prints a default response.
You don't have to have a unique response for these checks if you want to keep the magic word and passwords a
secret to the user.
Rules
DO NOT rename the variables included with the starter code
DO NOT remove the while loop -- it is necessary to run the constant chat or the breaking condition
statement (see lines 48+49) -- it is necessary to end the program. You are, however, allowed to change
the exit command variable EXIT_COMMAND at the top of the code.
Libraries (aside from the import random that is already included) are NOT ALLOWED to be imported.
This includes built-in Python libraries and external libraries.
Only use ASCII characters. Avoid using special characters or emojis.
README.md 2025-01-27
3 / 3
As per the syllabus, and for all assignments in this class, CODE FROM GENERATIVE AI IS PROHIBITED.
The code you turn in is your own. The code will be checked for plagiarism.
Hints
Be careful about the ordering of the conditionals and use of if-elif-else for these statements. The magic
word and password checks take the highest priority.
Have your bot ask the user questions after a response. It facilitates better chatting.
Make your default responses generic. It makes the chatbot more realistic and facilitates better chatting.
Test your chatbot out with friends and family and see how your bot responds!
Submission
Submit ONLY the Python file labeled simplebot-p1-[LASTNAME].py (where [LASTNAME] is your last name)
to Blackboard. The project is due at 2/16 11:59pm. For each hour, h, that it is late, your grade is reduced by h
points.
Rubric (100 pts)
General
[5 pts] Correct file is turned in and is correctly named (see Submission above).
[5 pts] Code runs without errors.
[10 pts] Code has header documentation -- name, date, class course name and section, and program
description
[10 pts] while statement loop and exiting condition are not modified
Bot Interaction
[10 pts] The responses are all different.
[5 pts] The user's name is saved and printed in at least one of the responses.
[5 pts] The bot's name is saved and printed in at least one of the responses.
[10 pts] 3 conditionals that check if a word is in the input (word-based conditional)
[10 pts] 3 conditionals that check if the entire input exactly matches a phrase (phrase-based
conditional)
[10 pts] 1 default conditional with 4 possible responses chosen at random
Ending Interaction
[10 pts] The magic word count is incremented, printed at the end of the session, and the correct
number of times it is said by the user is accurate.
[10 pts] The 2 passwords are different and the secret message is printed at the end if both words are
said in one user input during the session.
软件开发、广告设计客服
QQ:99515681
邮箱:99515681@qq.com
工作时间:8:00-23:00
微信:codinghelp
热点项目
更多
代做mime 473 – winter 2025 ...
2025-02-20
代写cit 5960 2025 - hw4代写留...
2025-02-20
代做econ 440.602: macroecono...
2025-02-20
代写phas0008 experimental me...
2025-02-20
代做emet4314/8014 advanced e...
2025-02-20
代写project 4: composition p...
2025-02-20
代写st332 & st409 medica...
2025-02-20
代写comp212 - 2025 - ca assi...
2025-02-20
代写construction specialisat...
2025-02-20
代做ma dcs 7aavdc29 practica...
2025-02-20
代做cs 4293 topics on cybers...
2025-02-20
代写as.440.601 microeconomic...
2025-02-20
代做project 3: composition p...
2025-02-20
热点标签
mktg2509
csci 2600
38170
lng302
csse3010
phas3226
77938
arch1162
engn4536/engn6536
acx5903
comp151101
phl245
cse12
comp9312
stat3016/6016
phas0038
comp2140
6qqmb312
xjco3011
rest0005
ematm0051
5qqmn219
lubs5062m
eee8155
cege0100
eap033
artd1109
mat246
etc3430
ecmm462
mis102
inft6800
ddes9903
comp6521
comp9517
comp3331/9331
comp4337
comp6008
comp9414
bu.231.790.81
man00150m
csb352h
math1041
eengm4100
isys1002
08
6057cem
mktg3504
mthm036
mtrx1701
mth3241
eeee3086
cmp-7038b
cmp-7000a
ints4010
econ2151
infs5710
fins5516
fin3309
fins5510
gsoe9340
math2007
math2036
soee5010
mark3088
infs3605
elec9714
comp2271
ma214
comp2211
infs3604
600426
sit254
acct3091
bbt405
msin0116
com107/com113
mark5826
sit120
comp9021
eco2101
eeen40700
cs253
ece3114
ecmm447
chns3000
math377
itd102
comp9444
comp(2041|9044)
econ0060
econ7230
mgt001371
ecs-323
cs6250
mgdi60012
mdia2012
comm221001
comm5000
ma1008
engl642
econ241
com333
math367
mis201
nbs-7041x
meek16104
econ2003
comm1190
mbas902
comp-1027
dpst1091
comp7315
eppd1033
m06
ee3025
msci231
bb113/bbs1063
fc709
comp3425
comp9417
econ42915
cb9101
math1102e
chme0017
fc307
mkt60104
5522usst
litr1-uc6201.200
ee1102
cosc2803
math39512
omp9727
int2067/int5051
bsb151
mgt253
fc021
babs2202
mis2002s
phya21
18-213
cege0012
mdia1002
math38032
mech5125
07
cisc102
mgx3110
cs240
11175
fin3020s
eco3420
ictten622
comp9727
cpt111
de114102d
mgm320h5s
bafi1019
math21112
efim20036
mn-3503
fins5568
110.807
bcpm000028
info6030
bma0092
bcpm0054
math20212
ce335
cs365
cenv6141
ftec5580
math2010
ec3450
comm1170
ecmt1010
csci-ua.0480-003
econ12-200
ib3960
ectb60h3f
cs247—assignment
tk3163
ics3u
ib3j80
comp20008
comp9334
eppd1063
acct2343
cct109
isys1055/3412
math350-real
math2014
eec180
stat141b
econ2101
msinm014/msing014/msing014b
fit2004
comp643
bu1002
cm2030
联系我们
- QQ: 9951568
© 2021
www.rj363.com
软件定制开发网!