37.0k views
3 votes
Create a program that simulates a chatbot helping a customer look up the status of an order on an online store.

1. Include comments with your name, date, and the purpose of your program at the start of the program.

2. The program should prompt the user for their name, 5-digit customer number, and 8-digit order number.

3. Greet the customer by name and let them know an agent will be with them soon.

4. The agent should tell the customer they are checking the order status, displaying their order status number.

5. The agent should provide the customer with their order status. Order status should be a variable you initialize to the value of your choice (in progress, delayed, or shipped).

6. The agent should give the customer a chat number for reference. The chat number should be a concatenation of:
a. the first three digits of the customer number and
b. the last four digits of the order number

1 Answer

3 votes

# Author: [Your Name]

# Date: [Today's Date]

# Purpose: Simulate a chatbot to help a customer look up the status of an order on an online store

# Import time module for simulating agent processing time

import time

# Prompt the user for their name, 5-digit customer number, and 8-digit order number

name = input("Hello! May I have your name, please? ")

customer_number = int(input("Thank you, {name}. May I have your 5-digit customer number, please? "))

order_number = int(input("Thank you. May I have your 8-digit order number, please? "))

# Greet the customer by name and let them know an agent will be with them soon

print(f"\\Hi {name}, an agent will be with you shortly.")

# Simulate agent processing time

time.sleep(2)

# The agent should tell the customer they are checking the order status, displaying their order status number

print("\\Agent: Checking your order status, please wait...")

# Initialize the order status variable with a value of your choice (in progress, delayed, or shipped)

order_status = "shipped"

# The agent should provide the customer with their order status

print(f"\\Agent: Your order status is {order_status}.")

# The agent should give the customer a chat number for reference

chat_number = str(customer_number[0:3]) + str(order_number[4:])

print(f"\\Agent: Your chat number is {chat_number} for future reference.")

This simple Python program simulates a chatbot for an online store that helps a customer look up the status of their order. The program prompts the user for their name, 5-digit customer number, and 8-digit order number, greets the customer, simulates a processing time, displays the order status, and provides a chat number for reference.

User Fred August
by
7.6k points